Date and Time! (Swift in Xcode)

Date and Time! (Swift in Xcode)

Jared Davidson

8 лет назад

33,524 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

The VFX Dude
The VFX Dude - 04.05.2022 17:30

Hey! I need help. If I follow your steps after the build this error occures:

Thread 1: "-[My_Project_Name.ViewController updateTime]: unrecognized selector sent to instance 0x7fec1ed09510

What do I have to do?

Ответить
Simron Kaur
Simron Kaur - 22.01.2019 03:06

Hello, really helpful video. But how do you change the time and date for a certain country? Please help!

Ответить
Matteo Sarli
Matteo Sarli - 18.01.2019 19:17

But what if I want to save the time and not update?....great videos

Ответить
John Gibson
John Gibson - 11.07.2018 21:22

Three years later, this is just what I was looking for. Thank you!!

Ответить
Engineering Manager
Engineering Manager - 15.06.2018 22:30

Sweet swift coding A+

Ответить
Moh'd Mahdi
Moh'd Mahdi - 26.10.2017 02:27

I’m using xcode 9 and NSdateformatter is not recognized , what is the new method for that !?

Ответить
Dylan McDonald
Dylan McDonald - 04.10.2017 03:15

This whole tutorial is unfortunately useless in Swift 4, as NSDateFormatter was obsoleted. Good video anyway, though!

Ответить
lucaguitarplayer
lucaguitarplayer - 13.09.2017 18:09

and in Swift 3?

Ответить
Rabia Daud
Rabia Daud - 04.05.2017 16:03

i found no option of NSDateFormatter what i do now????

Ответить
Mosaic Fox
Mosaic Fox - 27.02.2017 12:03

Hi Jared! Great Video. Just a question! What if i just want to display "Monday" which is the day of the week without showing the rest. How do i add it into the code?

Ответить
Govind Rajan
Govind Rajan - 24.01.2017 22:20

Keep up the good work. Awesome tutorial

Ответить
kareem fekry
kareem fekry - 24.01.2017 01:13

i need to know how to display this 1456725600000 in date format

and what is wrong with that??????

let timeAsInt: Double = 1456466400000

let timeAsInterval: NSTimeInterval = Double(timeAsInt)/1000

let theDate = NSDate(timeIntervalSince1970: timeAsInterval)



let newStringgDate = String(theDate)


let formatter = NSDateFormatter()
formatter.dateFormat = "dd-MM-yyyy"
formatter.dateStyle = NSDateFormatterStyle.MediumStyle
let defaultTimeZoneStr = formatter.dateFromString(newStringgDate)
print ("this is the new date \(defaultTimeZoneStr)")

when i print defaultTimeZoneStr it retrieve nil
thankss

Ответить
Sahib Singh
Sahib Singh - 03.01.2017 19:24

Please can you start tutorials for python

Ответить
Anchoright
Anchoright - 15.11.2016 23:13

Hi Jared! Great Tutorial! Is there a way I can change the time to show a different time zone?

Ответить
Alexander K
Alexander K - 14.11.2016 16:57

Nice. Thanks :)

Ответить
mana dody
mana dody - 18.10.2016 16:22

Thanks

Ответить
NomadWorks
NomadWorks - 14.10.2016 13:38

Great Work! how easy would it be to make an app that only shows week numbers?.

Ответить
Richard Ottley
Richard Ottley - 29.09.2016 18:31

I'm getting 2 error messages when I type
Label.text = DateFormatter.localizedString(from: <Date>, dateStyle: DateFormatterStyle.MediumStyle, timeStyle: DateFormatterStyle.ShortStyle)
}

Ответить
Jack’sMacintosh
Jack’sMacintosh - 13.09.2016 19:34

Hey Jared!
Great video first of all :)
I was wondering there was a way to get the individual hour/minute
like, to have a variable called hour and have it equal say, 12 (if the current time is noon)?
Thanks in advance :)

Ответить
Mr.IBla
Mr.IBla - 27.07.2016 21:49

how to make just the day something like just saturday

Ответить