[PD] unixtime = e+09

Mathieu Bouchard matju at artengine.ca
Thu Dec 1 16:44:49 CET 2011


Le 2011-12-01 à 09:06:00, patrick a écrit :

> i'm sending 2 informations via tcp: float + space + unixtime i use 
> tcpserver from mrpeach (thx!) and convert the output to asciic to pd 
> (mtl/asciiToPd). so far so good, but the unixtime format is: 1.32276e+09 
> instead of 1322755374. how to deal with this situation, i can send the 
> information as a string if i replace the space by a char, but then how 
> to split to a float and an interger (mrpeach/str csplit = error: print: 
> no method for blob so far...).

to avoid that kind of problem, [unix_time] gives it as number of days 
since 1er janvier 1970, and number of seconds within the day, separately. 
This means that you split your time by dividing by 86400 and sending the 
remainder along the quotient.

See outlet 1 in http://gridflow.ca/help/unix_time-help.html

Avoid string hacks whenever possible, because the alternative is so easy 
and never give you insidious problems such as symbol-leaks.

  ______________________________________________________________________
| Mathieu BOUCHARD ----- téléphone : +1.514.383.3801 ----- Montréal, QC


More information about the Pd-list mailing list