I am curious if there is a method of generating a time stamp that would work in the unix system as a time stamp for setting a date and time, in a standalone.
I did not see any references in the docs or the dictionary, so just wondering if it is out there but just not documented.
I know in PHP I can,
mktime(hour, minute, second, month, day, year)
in Javascript,
var unixtime = Date.parse("25-Feb-2011 17:57:35").getTime()/1000
anyone know how this can be done using livecode?
unix time stamp
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: unix time stamp
See dateItems in the Dictionary, e.g.:
put the date into tVar
convert tVar to dateItems
put the date into tVar
convert tVar to dateItems
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 10052
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: unix time stamp
Which gives you:FourthWorld wrote:See dateItems in the Dictionary, e.g.:
put the date into tVar
convert tVar to dateItems
2011,2,25,0,0,0,6
The Dictionary explains what each of those means.
You may also like the Internet date:
put the internet date
That gives you:
Fri, 25 Feb 2011 06:58:41 -0800
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: unix time stamp
That is interesting, what I am doing is using a desktop app to generate a script, part of that script process requires a valid unix time stamp, (in the future)
Funny thing when I used the search feature in the dictionary for unix date or time it showed no results, I also tried time and day, in the search but nothing happened, but sure enough when I used date items it showed the info,
I may need to revisit my script because I think that converting from live code format to unix may be somewhat of a challenge.
Thanks for posting that it does help, it looks like most of the data is already there, it may be that I am not grasping the array concept entirely.
Funny thing when I used the search feature in the dictionary for unix date or time it showed no results, I also tried time and day, in the search but nothing happened, but sure enough when I used date items it showed the info,
I may need to revisit my script because I think that converting from live code format to unix may be somewhat of a challenge.
Thanks for posting that it does help, it looks like most of the data is already there, it may be that I am not grasping the array concept entirely.