NuPlay / SwiftyMoment

Date To String

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SwiftyMoment

스크린샷 2021-04-17 오후 12 37 14 스크린샷 2021-04-17 오후 12 37 22
Code PreView

스크린샷 2021-04-17 오후 12 32 24

Code

import SwiftUI
import SwiftyMoment

struct SwiftyMoment_Test: View {
    var testDate : Date = Calendar.current.date(byAdding: .day, value: -7, to: Date())!
    
    var body: some View {
        VStack(spacing: 24){
            Text(SwiftyMoment(date: 1095379200 * 1000))
            Text(SwiftyMoment(date: testDate))
        }
    }
}

How To Use

  • You can use the Date type and the Unix time(Int) type.
  • Unix time (Int) is based on ms, so if you want to use second as the picture above, you have to do * 1000.

About

Date To String

License:MIT License


Languages

Language:Swift 100.0%