Converting timestamps

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Babyprincess
Posts: 17
Joined: Sat Aug 10, 2013 3:23 pm

Converting timestamps

Post by Babyprincess » Wed Aug 14, 2013 4:38 pm

Hello,

Currently i have time stamps in Epoch format in my database. How do i convert it to normal date format.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Converting timestamps

Post by dunbarx » Wed Aug 14, 2013 5:19 pm

Hi.

Well, I just looked up to see what "Epoch" time was.

Since that protocol starts at midnight, 1/1/1970 GMT, you are already in good shape. LC uses the same base. Watch your timezone, of course.

Craig Newman

EDIT:

Was your question how to convert the format? Look up both "seconds" and "convert" in the dictionary. Pay particular attention to the "dateItems" format, which gives great information, and you can manipulate the individual items in that string to change to a new date.

Babyprincess
Posts: 17
Joined: Sat Aug 10, 2013 3:23 pm

Re: Converting timestamps

Post by Babyprincess » Wed Aug 14, 2013 5:32 pm

Hi Dunbarx,

Thanks. Will look into it (:

Gautami
Posts: 35
Joined: Tue Aug 06, 2013 5:25 am

Re: Converting timestamps

Post by Gautami » Thu Aug 15, 2013 4:38 pm

Hey BabyPrincess,

you have to
-----------------------
convert "timestamp" to dateItems
convert it from dateItems to long date and long time
-----------------------

Reg,
G

Babyprincess
Posts: 17
Joined: Sat Aug 10, 2013 3:23 pm

Re: Converting timestamps

Post by Babyprincess » Thu Aug 15, 2013 7:19 pm

Thanks everyone.

I managed to get it working perfectly !

God bless (:

Post Reply