Get todays date time in kdb - Kdb+ / qStudio

Home Forums Kdb+ / qStudio Get todays date time in kdb

Tagged: , ,

This topic contains 3 replies, has 3 voices, and was last updated by  John Dempster 6 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #344

    Johnny Chan

    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.


    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.


    For a full list of available date time types see here:

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.