Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Convert minutes to timestamp

I need to create a datetime from data that is stored in two separate field.  The date field is stored as a datetime, but the time part is always 00:00:00 so I need to extract just the date.  The time field is stored as minutes after midnight, i.e. 630 = 10:30:00 AM.

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

Load like this

T1:

Load * Inline [
Time
630
]
;

T2:
Load Time,
Timestamp('00:'&Time,'hh:mm:ss[.fff] TT') as Hours
Resident T1;
Drop Table T1;

Hope it helps you..

View solution in original post

7 Replies
Not applicable
Author

Karen Gerdes wrote:

I need to create a datetime from data that is stored in two separate field.  The date field is stored as a datetime, but the time part is always 00:00:00 so I need to extract just the date.  The time field is stored as minutes after midnight, i.e. 630 = 10:30:00 AM.

tresesco
MVP
MVP

If you need just the date, should not be bothered about time part, try like:

Load

          Date(Floor(YourDateField)) as NewDate

maxgro
MVP
MVP

=datetimefield + timeinminutesfield / (24*60)

Not applicable
Author

datetime.adjust(string.datetime(date,"MMDDCCYY"),1,"Y")

datetime.adjust(srting.datetime(date,"MMDDCCYY"),1,"Y",false)

Not applicable
Author

Hi,

Load like this

T1:

Load * Inline [
Time
630
]
;

T2:
Load Time,
Timestamp('00:'&Time,'hh:mm:ss[.fff] TT') as Hours
Resident T1;
Drop Table T1;

Hope it helps you..

Not applicable
Author

Hi Karen,

you can try the Time Function.

e.g. Time(A) where  A=630

Not applicable
Author

Thank you for all the help.  It looks like this worked:

 

timestamp#

(Date(Floor(start_date))&' '& Timestamp('00:'&start_time,'hh:mm:ssTT'),'YYYY-MM-DD hh:mm:ss')