[PD-dev] common date format for Pd

martinrp at alcor.concordia.ca martinrp at alcor.concordia.ca
Mon Jun 12 20:43:42 CEST 2006


I also ran into this when attempting to use IP addresses. The solution I came
up
with was to make the address a list of floats like 192 168 0 1.
I think it's more useful to do this with dates as well: a list 2006 6 12 12 0 0
is much easier to manipulate in pd than a symbol, which would need its own
external to parse.
I wrote a timestamp external a few months ago that outputs a list of floats as
[year month day hour minute second millisecond] but I have a horrible feeling
the only copy is on a dead hard drive :(. It's easy enough to reconstruct
though.

Martin


Quoting Hans-Christoph Steiner <hans at eds.org>:

> 
> Since Pd only has 19bits of integer resolution, we can't use UNIX  
> time within Pd. So I was thinking that perhaps ISO format would would  
> well in Pd since its a symbol:
> 
> For example:
> 
> Today is 2006-06-12.  This email was sent written at 12:40:23.  All  
> of this can be lumped together as 20060612T124023.  I am not sure if  
> this ISO unified date/time format officially supports fractional  
> seconds, but since it does support fractional seconds in the time  
> (12:40:23.2342), and the digit positions are fixed, so I think we can  
> easily just tack on fractional seconds like this:  
> 20060612T124023.2342.  I think keeping the "." is preferable since  
> ISO 8601 says 12:40:23.2342 can be shorted to 124023.2342, but I  
> didn't see mention of 1240232342.
> 
> One problem is that ISO 8601 allows you to omit the separators "-"  
> and ":", which would then make it a float in Pd, and therefore it  
> would be truncated to 6 digits.  So we couldn't support that.
> 
> Here's a page all about ISO 8601 date/time formats:
> 
> http://www.cl.cam.ac.uk/~mgk25/iso-time.html#time
> 
> Thoughts? Comments? Flames? ;)
> 
> .hc
> 
> ------------------------------------------------------------------------
> 
> I have the audacity to believe that peoples everywhere can have three  
> meals a day for their bodies, education and culture for their minds,  
> and dignity, equality and freedom for their spirits.      - Martin  
> Luther King, Jr.
> 
> 
> 
> _______________________________________________
> PD-dev mailing list
> PD-dev at iem.at
> http://lists.puredata.info/listinfo/pd-dev
> 


-- 





More information about the Pd-dev mailing list