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 comments Hi 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 inverse Currently, if you pass a date-time string to the date:seconds() function, then it gives you the number of seconds since 1970-01-01T00:00:00. So date:seconds() works as date:date-time-to-epoch-time() as above. What's more, if you call date:seconds() without an argument, it acts on the current date-time, so in fact date:seconds() without an argument is the same as date:epoch-time() as above. You can do date:epoch-time-to-date-time() by turning the number of seconds into a duration and adding that to the start of the epoch, as in: date:add('1970-01-01T00:00:00', date:duration($seconds)) Perhaps that's worth a shorthand -- possibly date:date-time() should have an optional argument, being a number of seconds since 1970-01-01T00:00:00 -- I'm not sure. There's an argument that date:seconds() shouldn't be overloaded, and shouldn't be tied to a particular epoch, especially the computer-oriented one of 1970-01-01T00:00:00 (Mike suggested Julian dates instead), but my feeling was (and is) that it's a common enough representation that it's worthwhile to support it specifically. For other 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:

    
  1. Re: feature request-- [epoch] ( John Peacock 2004)
  2. Re: feature request-- [epoch] ( Donovan Brooke 2004)
  3. Re: feature request-- [epoch] ( Donovan Brooke 2004)
  4. Re: feature request-- [epoch] ( "Dan Strong" 2004)
  5. Re: feature request-- [epoch] ( John Peacock 2004)
  6. Re: feature request-- [epoch] ( "Dan Strong" 2004)
  7. Re: feature request-- [epoch] ( "Nitai @ ComputerOil" 2004)
  8. Re: feature request-- [epoch] ( John Peacock 2004)
  9. Re: feature request-- [epoch] ( Donovan Brooke 2004)
  10. Re: feature request-- [epoch] ( "Nitai @ ComputerOil" 2004)
  11. Re: feature request-- [epoch] ( Donovan Brooke 2004)
  12. feature request-- [epoch] ( Donovan Brooke 2004)
Here are some relative comments I found from another source: --begin comments Hi 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 inverse Currently, if you pass a date-time string to the date:seconds() function, then it gives you the number of seconds since 1970-01-01T00:00:00. So date:seconds() works as date:date-time-to-epoch-time() as above. What's more, if you call date:seconds() without an argument, it acts on the current date-time, so in fact date:seconds() without an argument is the same as date:epoch-time() as above. You can do date:epoch-time-to-date-time() by turning the number of seconds into a duration and adding that to the start of the epoch, as in: date:add('1970-01-01T00:00:00', date:duration($seconds)) Perhaps that's worth a shorthand -- possibly date:date-time() should have an optional argument, being a number of seconds since 1970-01-01T00:00:00 -- I'm not sure. There's an argument that date:seconds() shouldn't be overloaded, and shouldn't be tied to a particular epoch, especially the computer-oriented one of 1970-01-01T00:00:00 (Mike suggested Julian dates instead), but my feeling was (and is) that it's a common enough representation that it's worthwhile to support it specifically. For other 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 Book? (2003) WebCat2.0 [format thousands .0f] no go (1997) SKU lookup (1997) with Link i need to (1997) [WebDNA] Install/config issue: WebDNA-MacTel-6.2>OS X Server (2009) Colocator Upgrading OS (2004) encripted storage (1998) Country & Ship-to address & other fields ? (1997) Ready,Set; Print! (1999) serial number generation (1997) Re:HELP - NONE STOP DIGESTS. Digest for 4/24/97) (1997) Bad dates/times on a Windows server? (2002) Separate SSL Server (1997) countdown to date (2003) Triggers (1999) Reversed words (1997) Sendmail html/text and CCS problem (2003) Where is f2? (1997) Setting up WebCatalog with Retail Pro data (1996) Show if time tags (1997)