<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>28 May 2018 20:58:00 Z</lastBuildDate><pubDate>28 May 2018 08:30:00 Z</pubDate><description>Hi,&#13;
there's an unexpected difficulty (only for me?) in calculating a duration. The problem is simple.&#13;
&#13;
A Date item (defined for YYYYMMDDhhmmssccc) of the file HISTORY receives the Log-in Date and Time:&#13;
GPW_HISTORY.HISTORY_LOGIN = DateToString(DateSys(),"YYYYMMDD")+TimeToString(TimeSys(),"HHMMSS")&#13;
&#13;
Same goes for a logout. Whenever the main menue is closed then the log-out is recorded in another Date item&#13;
GPW_HISTORY.HISTORY_LOGOUT = DateToString(DateSys(),"YYYYMMDD")+TimeToString(TimeSys(),"HHMMSS")&#13;
&#13;
Of course, there will be no logout Date+Time if the program crashes somewhen or as long as the user's session has not been terminated.&#13;
&#13;
A table control shows both items correctly in their columns (defined as Dates, returning YYYYMMDDhhmmss). One could be happy with that, but now I want to show the exact time which elapsed between a Log-in and Log-out in a third column of the table.&#13;
&#13;
I created a column with type of Duration, which will return DHHMMSSLLL and displays +2d d H h MM m SS s CCC ms. Using DateTimeDifference(..) of the LOGOUT / LOGIN datetime columns shows incorrect results! Does any of you know what's going on here or is there a solution??&#13;
&#13;
The code&#13;
IF Table.HISTORY_LOGIN &lt;&gt; Null AND Table.HISTORY_LOGOUT &lt;&gt; Null THEN DateTimeLOGIN = Table.HISTORY_LOGIN DateTimeLOGOUT = Table.HISTORY_LOGOUT MyDuration = DateTimeDifference(DateTimeLOGIN,DateTimeLOGOUT) Table.DAUER = MyDuration ELSE Table.DAUER = 0 END [attachment 2712 LoginDauer.png]</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65617-wd23-datetime-duration/read.awp</link><title>[WD23] DateTime / Duration</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65617-wd23-datetime-duration-65628/read.awp</comments><pubDate>28 May 2018 20:58:00 Z</pubDate><description>Hi Guenter,&#13;
&#13;
yes the extra "0". I just remember that some time functions Need this, because they are counting the milliseconds…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65617-wd23-datetime-duration-65628/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65617-wd23-datetime-duration-65628/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65617-wd23-datetime-duration/read.awp">[WD23] DateTime / Duration</source><title>Re: [WD23] DateTime / Duration</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65617-wd23-datetime-duration-65623/read.awp</comments><pubDate>28 May 2018 10:57:00 Z</pubDate><description>Hi Erik, thank you! Yes, I saw that ... after some tweaking the code the solution looks quite simple like that:&#13;
&#13;
DateTimeLOGIN…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65617-wd23-datetime-duration-65623/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65617-wd23-datetime-duration-65623/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65617-wd23-datetime-duration/read.awp">[WD23] DateTime / Duration</source><title>Re: [WD23] DateTime / Duration</title></item><item><author>guest</author><category>pcsoft.us.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65617-wd23-datetime-duration-65622/read.awp</comments><pubDate>28 May 2018 09:24:00 Z</pubDate><description>Hi Günter,&#13;
&#13;
seems to be a formatting Problem only.&#13;
&#13;
The values are correct, for example the first two lines:&#13;
&#13;
01s300ms (sh…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65617-wd23-datetime-duration-65622/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65617-wd23-datetime-duration-65622/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/65617-wd23-datetime-duration/read.awp">[WD23] DateTime / Duration</source><title>Re: [WD23] DateTime / Duration</title></item></channel></rss>
