Joining time and date attributes to form date_time attributes

wessel
wessel New Altair Community Member
edited November 2024 in Community Q&A
Dear all,

What is an efficient way of combining date and time attributes into a date time attribute?
E.g. first attribute = days of epoch e.g. 31-11-2013
E.g. second attribute = time of day e.g. 14:55:02

Best regards,

Wessel
Tagged:

Answers

  • JEdward
    JEdward New Altair Community Member
    Generate Attributes operator is the first I can think of.

    Combine the two attributes with Concat into a text string and then use custom parse date to convert to a date_time. 
  • wessel
    wessel New Altair Community Member
    Hey Edward,

    You are right, this works, thanks.

    If possible, I would prefer to not have to parse dates.
    This was missing from my original question.
    In generate attributes there seems to be a date_add() function.

    Best regards,

    Wessel
  • wessel
    wessel New Altair Community Member
    I think you can do this:

    date_add(Date, MyNumberOfMinutesAttributeGeneratedWithDateToNumerical, DATE_UNIT_MINUTE)