Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I format a datetime on sqlite with timezone?

for example I have this date jan 5, 2010 14:00 wednesday gmt-8 how do I implement this so I can save it with timezone?,

I can save this using nsformatter with yyyy-MM-dd hh:mm and saves as

2010-01-05 14:00

but how about w/ timezone?

(it should be saved in datetime format.. not text format)

like image 756
user3517855 Avatar asked Apr 10 '26 20:04

user3517855


1 Answers

You can use [format setDateFormat:@"yyyy-MM-dd hh:mm a"] for timezone it will give output like this "2010-01-05 02:00 PM"

or [format setDateFormat:@"MMM dd, yyyy hh:mm a"]

like image 176
Nisha Avatar answered Apr 12 '26 10:04

Nisha