Skip to content

Instantly share code, notes, and snippets.

@wandernauta
Created May 16, 2010 17:54
Show Gist options
  • Save wandernauta/403039 to your computer and use it in GitHub Desktop.
Save wandernauta/403039 to your computer and use it in GitHub Desktop.
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