help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] DateTime


From: Stefan Izota
Subject: [Help-smalltalk] DateTime
Date: Thu, 26 Nov 2009 18:43:08 +0200
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Hi all,

I did not find a way to convert seconds to DateTime so I wrote something like this:

DateTime class extend [
   fromSeconds: seconds [
       | date time |
date := Date fromSeconds: seconds.
       time := Time fromSeconds: (seconds - date asSeconds).
       ^ DateTime date: date time: time
   ]
]

Is there other way to do this?

Thanks,
Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]