Created
May 16, 2010 17:54
-
-
Save wandernauta/403039 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os/Time | |
include time | |
/* Functions (don't use these) */ | |
strftime: extern func(dest: String*, maxsize: SizeT, format: String*, tm: TMStruct*) -> SizeT | |
/* Classes (use these) */ | |
CalendarTime: cover from TMStruct { | |
} | |
TimeStamp: class { | |
tt: TimeT | |
init: func() { | |
this tt = time(null) | |
} | |
format: func(fmt: String) -> String { | |
ret := "" | |
"Ret: %s" format(ret) println() | |
"Fmt: %s" format(fmt) println() | |
strftime(ret, 2048, fmt, localtime(this tt&)) | |
return ret | |
} | |
} | |
TimeSpan: class { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment