LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
jmburnod
- VIP Livecode Opensource Backer

- Posts: 2729
- Joined: Sat Dec 22, 2007 5:35 pm
-
Contact:
Post
by jmburnod » Sat Jun 18, 2011 5:16 pm
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
https://alternatic.ch
-
bn
- VIP Livecode Opensource Backer

- Posts: 4172
- Joined: Sun Jan 07, 2007 9:12 pm
Post
by bn » Sat Jun 18, 2011 5:36 pm
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
the result will be equal
Kind regards
Bernd
-
jmburnod
- VIP Livecode Opensource Backer

- Posts: 2729
- Joined: Sat Dec 22, 2007 5:35 pm
-
Contact:
Post
by jmburnod » Sat Jun 18, 2011 5:49 pm
Salut Bernd,
Thank one more.
With long time instead abbrevaited time it work like an Helvetic watch.
Best regards
Jean-Marc
https://alternatic.ch