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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

date & time

hi,

i have feild with date & time, like this " DD-MM-YYYY  HH:MM:SS"

how can i separate to 2 feilds ,date alone and time alone ?

thanks'

yarin.

1 Solution

Accepted Solutions
Not applicable
Author

To remove the time and preserve as a date field, assuming your field is called InputDate, use:

Date(Floor(InputDate))

To get just the time, use:

Time(InputDate)

View solution in original post

4 Replies
nagaiank
Specialist III
Specialist III

DateField=SubField(DateAndTimeField,' ')

TimeField=SubField(DateAndTimeField,' ',2)

You can format the fields as needed by the application.

Anonymous
Not applicable
Author

hi,

can you please explain more,tha name of my feild is "start".

i don't know this function and the help (f1) doesn't help.

thanks'

yarin.

Not applicable
Author

To remove the time and preserve as a date field, assuming your field is called InputDate, use:

Date(Floor(InputDate))

To get just the time, use:

Time(InputDate)

nagaiank
Specialist III
Specialist III

If the name of your field is 'start', and if you want date alone in a field named 'Date' and time alone in a field names 'Time', use the following expressions.

Date=SubField(start,' ')

Time=SubField(state,' ',2)

The function used is SubField() and the help states the following:

subfield(s, 'delimiter' [ , index ] )

In its three-parameter version, this script function returns a given substring from a larger string s with delimiter

'delimiter'. index is an optional integer denoting which of the substrings should be returned. ....