Page 1 of 1

convert date

Posted: Sat Jun 18, 2011 5:16 pm
by jmburnod
Hi All,

I have two differents results after two convert of the same value
What i forget ?

Code: Select all

on tConvert
   put 1308408220 into MySec1
   put ConFromSecToTime(MySec1) into tdate
   put tdate into myDate
   put ConFromdateToSec(mydate) into mySec2
   dansmes MySec1&return&mySec2 --•• MySec1 = 1308408220 BUT mySec2 = 1308408180
end tConvert

function ConFromSecToTime pTime
   convert pTime to abbreviated date and abbreviated time
   return pTime
end ConFromSecToTime

function ConFromdateToSec pDate
   convert pDate to seconds
  return pDate
end ConFromdateToSec
Thank

Jean-Marc

Re: convert date

Posted: Sat Jun 18, 2011 5:36 pm
by bn
Hi Jean-Marc,

in the second function you pass the date and the hours and the minutes ( to which you converted the seconds before). So it returns the seconds up to the minute you indicate. It does not know that you want 40 seconds more :)

if you put

Code: Select all

 put 1308408180 into MySec1
the result will be equal

Kind regards

Bernd

Re: convert date

Posted: Sat Jun 18, 2011 5:49 pm
by jmburnod
Salut Bernd,
Thank one more.
With long time instead abbrevaited time it work like an Helvetic watch.

Best regards

Jean-Marc