Re: [WebDNA] unix timestamp in WebDNA

This WebDNA talk-list message is from

2009


It keeps the original formatting.
numero = 102082
interpreted = N
texte = Dana, I should explain, this is for the number of seconds since 1/1/1970 (Unix epoch). To work for your application simply relace [date] with your date from the db, making sure it's format is MM/DD/YYYY. Marc Thompson wrote: > Here's an estimation within a few seconds: > [text]timestamp=[math]((([math]{[date]}[/math])-1)*86400)+([math]{[time]}[/math])[/math][/text] > [math show=f]time_now=[timestamp]*1[/math] > [math show=t]Aprox_Epoch_Time=[time_now]-62167107589[/math] > > > Marc > > Dana Keil wrote: >> On Feb 27, 2009, at 11:59 AM, Donovan Brooke wrote: >> >>> It would help if you describe your project a bit. >> Hi Donovan, >> >> Once I started getting answers (thanks everyone), I realized that what >> I'm wanting it for isn't obvious, who would have thought my question >> could be interpreted in so many different ways -- I know exactly what >> I'm thinking, why doesn't everyone else ;-). >> >> I have a site that is currently a "hybrid" WebDNA and PHP site (for >> historical reasons). I write WebDNA pages that return info to PHP when >> PHP uses cURL to hit the WebDNA page (and PHP can send info to WebDNA >> using cURL too, it works both ways quite nicely). >> >> The PHP wants to do some math on a date value that comes from WebDNA >> (stored as MM/DD/YYYY in a WebDNA db) and I would like to convert that >> to a unix timestamp form before passing it to PHP. If it was native >> WebDNA, of course, I wouldn't care about getting it into unix timestamp >> form at all. >> >> So the question is, does anyone have an already written function that >> will take a value coming from a WebDNA db in the MM/DD/YYYY format and >> turn it into a unix time number. >> >> -- >> Dana >> >> > -- ------------------------------------------- Marc Thompson Software Engineer Office of Information Technology University of Utah 801.585.9264 marc.thompson@utah.edu ------------------------------------------- Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] unix timestamp in WebDNA (Donovan Brooke 2009)
  2. Re: [WebDNA] unix timestamp in WebDNA (Dana Keil 2009)
  3. Re: [WebDNA] unix timestamp in WebDNA (Dana Keil 2009)
  4. Re: [WebDNA] unix timestamp in WebDNA (Marc Thompson 2009)
  5. Re: [WebDNA] unix timestamp in WebDNA (Marc Thompson 2009)
  6. Re: [WebDNA] unix timestamp in WebDNA (Dana Keil 2009)
  7. Re: [WebDNA] unix timestamp in WebDNA (Marc Thompson 2009)
  8. Re: [WebDNA] unix timestamp in WebDNA (Donovan Brooke 2009)
  9. Re: [WebDNA] unix timestamp in WebDNA (Dana Keil 2009)
  10. Re: [WebDNA] unix timestamp in WebDNA (Donovan Brooke 2009)
  11. Re: [WebDNA] unix timestamp in WebDNA (Donovan Brooke 2009)
  12. RE: [WebDNA] unix timestamp in WebDNA ("Olin Lagon" 2009)
  13. Re: [WebDNA] unix timestamp in WebDNA (Donovan Brooke 2009)
  14. Re: [WebDNA] unix timestamp in WebDNA (Marc Thompson 2009)
  15. [WebDNA] unix timestamp in WebDNA (Dana Keil 2009)
Dana, I should explain, this is for the number of seconds since 1/1/1970 (Unix epoch). To work for your application simply relace [date] with your date from the db, making sure it's format is MM/DD/YYYY. Marc Thompson wrote: > Here's an estimation within a few seconds: > [text]timestamp=[math]((([math]{[date]}[/math])-1)*86400)+([math]{[time]}[/math])[/math][/text] > [math show=f]time_now=[timestamp]*1[/math] > [math show=t]Aprox_Epoch_Time=[time_now]-62167107589[/math] > > > Marc > > Dana Keil wrote: >> On Feb 27, 2009, at 11:59 AM, Donovan Brooke wrote: >> >>> It would help if you describe your project a bit. >> Hi Donovan, >> >> Once I started getting answers (thanks everyone), I realized that what >> I'm wanting it for isn't obvious, who would have thought my question >> could be interpreted in so many different ways -- I know exactly what >> I'm thinking, why doesn't everyone else ;-). >> >> I have a site that is currently a "hybrid" WebDNA and PHP site (for >> historical reasons). I write WebDNA pages that return info to PHP when >> PHP uses cURL to hit the WebDNA page (and PHP can send info to WebDNA >> using cURL too, it works both ways quite nicely). >> >> The PHP wants to do some math on a date value that comes from WebDNA >> (stored as MM/DD/YYYY in a WebDNA db) and I would like to convert that >> to a unix timestamp form before passing it to PHP. If it was native >> WebDNA, of course, I wouldn't care about getting it into unix timestamp >> form at all. >> >> So the question is, does anyone have an already written function that >> will take a value coming from a WebDNA db in the MM/DD/YYYY format and >> turn it into a unix time number. >> >> -- >> Dana >> >> > -- ------------------------------------------- Marc Thompson Software Engineer Office of Information Technology University of Utah 801.585.9264 marc.thompson@utah.edu ------------------------------------------- Marc Thompson

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:

X etc.... (1999) Rollovers (1999) Re[2]: 2nd WebCatalog2 Feature Request (1996) [BULK] Fwd: [WebDNA] [BULK] WebDNA discovery in the Console - [having many crashes] (2011) Exclamation point (1997) problems with 2 tags (1997) Simple Store (2000) emailer (1997) [WebDNA] Is the AutoCommit preference still supported? (2010) two unique banners on one page (1997) SendTo more emails (1998) Unzip (2005) ReadDateFormat bug in 3.0.1 (1998) shipcost (1997) ShowNext Command (1997) This is an odd error (2001) [protect admin] (1997) OT: IP addres checking (2003) docs for WebCatalog2 (1997) interactive .pdf files and WebCatalog (2000)