Johnny ChanGuest
How do I find the date time for today and now in kdb?
The .z namespace contains functions for accessing the current data and time. e.g.
q).z.t
09:56:06.145
q).z.d
2013.05.21
The pattern is .z.{letter of data type wanted}
q)value each {x!x}`.z.p`.z.P`.z.t`.z.T`.z.d`.z.D`.z.n`.z.z`.z.Z
.z.p| 2013.05.21D09:56:06.145203000
.z.P| 2013.05.21D10:56:06.145203000
.z.t| 09:56:06.145
.z.T| 10:56:06.145
.z.d| 2013.05.21
.z.D| 2013.05.21
.z.n| 0D09:56:06.145203000
.z.z| 2013.05.21T09:56:06.145
.z.Z| 2013.05.21T10:56:06.145
The uppercase letters return local date time e.g. .z.Z
While the lowercase letters return GMT time
The offset is based on the OS settings.