Re: feature request-- [epoch]
This WebDNA talk-list message is from 2004
It keeps the original formatting.
numero = 55508
interpreted = N
texte = Here are some relative comments I found from another source:--begin commentsHi Norm, > In trying to work with the XML export from SourceForge, I see that > they store dates in the XML as seconds-since-1970. How quaint. > Anyway, this is actually a useful form sometimes. I wonder if it > makes sense to add: > > date:epoch-time() - returns the number of seconds since the epoch > (on Unix systems, the current epoch starts on Jan 1, 1970 at 00:00:00 GMT) > > date:epoch-time-to-date-time(int seconds) - returns a date-time for > a number of seconds > > date:date-time-to-epoch-time(string date-time) - does the inverseCurrently, if you pass a date-time string to the date:seconds()function, then it gives you the number of seconds since1970-01-01T00:00:00. So date:seconds() works asdate:date-time-to-epoch-time() as above.What's more, if you call date:seconds() without an argument, it actson the current date-time, so in fact date:seconds() without anargument is the same as date:epoch-time() as above.You can do date:epoch-time-to-date-time() by turning the number ofseconds into a duration and adding that to the start of the epoch, asin: date:add('1970-01-01T00:00:00', date:duration($seconds))Perhaps that's worth a shorthand -- possibly date:date-time() shouldhave an optional argument, being a number of seconds since1970-01-01T00:00:00 -- I'm not sure.There's an argument that date:seconds() shouldn't be overloaded, andshouldn't be tied to a particular epoch, especially thecomputer-oriented one of 1970-01-01T00:00:00 (Mike suggested Juliandates instead), but my feeling was (and is) that it's a common enoughrepresentation that it's worthwhile to support it specifically. Forother epochs, you could use: date:seconds(date:difference($epoch, $date-time))-- end coments-- =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:
Here are some relative comments I found from another source:--begin commentsHi Norm, > In trying to work with the XML export from SourceForge, I see that > they store dates in the XML as seconds-since-1970. How quaint. > Anyway, this is actually a useful form sometimes. I wonder if it > makes sense to add: > > date:epoch-time() - returns the number of seconds since the epoch > (on Unix systems, the current epoch starts on Jan 1, 1970 at 00:00:00 GMT) > > date:epoch-time-to-date-time(int seconds) - returns a date-time for > a number of seconds > > date:date-time-to-epoch-time(string date-time) - does the inverseCurrently, if you pass a date-time string to the date:seconds()function, then it gives you the number of seconds since1970-01-01T00:00:00. So date:seconds() works asdate:date-time-to-epoch-time() as above.What's more, if you call date:seconds() without an argument, it actson the current date-time, so in fact date:seconds() without anargument is the same as date:epoch-time() as above.You can do date:epoch-time-to-date-time() by turning the number ofseconds into a duration and adding that to the start of the epoch, asin: date:add('1970-01-01T00:00:00', date:duration($seconds))Perhaps that's worth a shorthand -- possibly date:date-time() shouldhave an optional argument, being a number of seconds since1970-01-01T00:00:00 -- I'm not sure.There's an argument that date:seconds() shouldn't be overloaded, andshouldn't be tied to a particular epoch, especially thecomputer-oriented one of 1970-01-01T00:00:00 (Mike suggested Juliandates instead), but my feeling was (and is) that it's a common enoughrepresentation that it's worthwhile to support it specifically. Forother epochs, you could use: date:seconds(date:difference($epoch, $date-time))-- end coments-- =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:
[WebDNA] drop off not round off (2011)
windows 95 netscape 3.01 browser bug? (1997)
[text show=f&secure=t] or ...? (2000)
Include File Tag (2003)
[WebDNA] Email With Auth (2013)
Linebreak as a delimiter in listwords? (2003)
WebCat editing, SiteGuard WAS:SiteAssociative lookup style? (1997)
show related items (2003)
WebCatalog Growth (2000)
Okay, I give up... (1999)
Potential Conflicts? (1997)
I want a 404 (2005)
Need help (1998)
WebCatalog [FoundItems] Problem - AGAIN - (1997)
cookies and [returnraw] (1997)
[COMMITDATABASE FileName] (2000)
Help Encrypt/Decrypt eMail (2003)
Limit on nested [ShowIf]'s? (1997)
Modifying order output (1997)
Languages (1997)