Skip to content

Instantly share code, notes, and snippets.

@wandernauta
Created May 16, 2010 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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