Re: Date+time
This WebDNA talk-list message is from 2004
It keeps the original formatting.
numero = 59498
interpreted = N
texte = Hi Aaron...Seconds since epoch is a *great* tool. This is the original code that was given to me byTom Duke.:[text]timestamp=[math]((([math]{[date]}[/math])-1)*86400)+([math]{[time]}[/math])[/math][/text]Date back = [format days_to_date][format .6d][math]([timestamp]/86400)+1[/math][/format][/format]Time back = [format seconds_to_time][math][timestamp]-(86400*[format ..6d][math]([timestamp]/86400)[/math][/format])[/math][/format]This works great for standard installs here in the US but I would force the mm/dd/yyyy format on the date variableto keep it portable and safe from users messing the date pref.I also have a modified version for use with GMT.imagine, comparisons down to the second. :-)(should be a tag in webdna but for now you could wrap it up in a [function] context if you like.)DonovanAaron Lynch wrote:> I need to store date and time in one field as a number, and then be able to> extract the date and time back from the number, similar to unix epoch time.> > Looking through the archives, I know this subject has come up a lot, but I> just can't seem to find a working way to do it. Does somebody have any> example of how to do it?-- =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o DONOVAN D. BROOKE Eucalyptus Design <-Web Development (specializing in eCommerce), -> <-Graphic Design, and Pre-Press Consultation -> ADDRESS:> Donovan Brooke DBA Eucalyptus Design N2862 Summerville Park Rd. Lodi, WI 53555 PH:> 1.608.592.3567 Web:> http://www.euca.us =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list
.To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Associated Messages, from the most recent to the oldest:
Hi Aaron...Seconds since epoch is a *great* tool. This is the original code that was given to me byTom Duke.:[text]timestamp=[math]((([math]{[date]}[/math])-1)*86400)+([math]{[time]}[/math])[/math][/text]Date back = [format days_to_date][format .6d][math]([timestamp]/86400)+1[/math][/format][/format]Time back = [format seconds_to_time][math][timestamp]-(86400*[format ..6d][math]([timestamp]/86400)[/math][/format])[/math][/format]This works great for standard installs here in the US but I would force the mm/dd/yyyy format on the date variableto keep it portable and safe from users messing the date pref.I also have a modified version for use with GMT.imagine, comparisons down to the second. :-)(should be a tag in webdna but for now you could wrap it up in a [function] context if you like.)DonovanAaron Lynch wrote:> I need to store date and time in one field as a number, and then be able to> extract the date and time back from the number, similar to unix epoch time.> > Looking through the archives, I know this subject has come up a lot, but I> just can't seem to find a working way to do it. Does somebody have any> example of how to do it?-- =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o DONOVAN D. BROOKE Eucalyptus Design <-Web Development (specializing in eCommerce), -> <-Graphic Design, and Pre-Press Consultation -> ADDRESS:> Donovan Brooke DBA Eucalyptus Design N2862 Summerville Park Rd. Lodi, WI 53555 PH:> 1.608.592.3567 Web:> http://www.euca.us =o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o=o-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/
Donovan Brooke
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
writefile to create static pages (2003)
WebCommerce: Folder organization ? (1997)
[WebDNA] divisible by 1 (2011)
linetiems in thankyou.tpl (1997)
Error Log.db --however (1997)
Error Lob.db records error message not name (1997)
Webcat 2.0.1 date math bug -> Crash! (1997)
Questions (1998)
WebCatalog for Postcards ? (1997)
PCS Frames (1997)
Transfering [text] variables (2000)
WebCat2b13MacPlugIn - [include] doesn't allow creator (1997)
Wanted: More Math Functions (or, Can You Solve This?) (1997)
[WebDNA] Test - no messages since 9th of June 2009. (2009)
Not Java, Javascript and WebDNA (2002)
[OT] Test (2003)
No luck with taxes (1997)
FlushDatabase Suggestion (1998)
Re:Remote stockroom ? (1998)
Replace context problem ... (1997)