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 3 years, 4 months ago.

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

    Johnny Chan

    How do I find the date time for today and now in kdb?

    #351

    admin
    Keymaster

    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

    #40252

    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.

    #111186

    For a full list of available date time types see here:
    http://www.timestored.com/b/forums/topic/kdb-date-time-types/

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

You must be logged in to reply to this topic.