Converting long integer into Time

Converting long integer into Time

  

Hi guys,


I have  a long integer data type in the database and I would like to convert this value into time to display on a table records, can you please let me know how this done.


kind regards 

Hi Imraan,

Can you please share what exact value you are getting from your DB or some examples so that we can help you in that?

Regards,

MJ

Manish Jawla wrote:

Hi Imraan,

Can you please share what exact value you are getting from your DB or some examples so that we can help you in that?

Regards,

MJ

The Value from the DB is something like 60(long integer type to cater for longer values in future), I want to convert that value into a time format(HH:MM). I want to use it to give a total time in a readable format instead of something like 120, I would like it to display as 02:00


Hello Imran,

There is a function TextToTime() you can try it.

Imraan Ismail wrote:

Manish Jawla wrote:

Hi Imraan,

Can you please share what exact value you are getting from your DB or some examples so that we can help you in that?

Regards,

MJ

The Value from the DB is something like 60(long integer type to cater for longer values in future), I want to convert that value into a time format(HH:MM). I want to use it to give a total time in a readable format instead of something like 120, I would like it to display as 02:00


Hello,

If your output from the DB is in seconds you can simply create a new date time from a null date, increment the seconds to the date format it as you wish.

Eg.:

FormatDateTime(AddSeconds(NullDate(),120),"mm:ss")

  

Regards,

DO

Amol Tupe wrote:

Hello Imran,

There is a function TextToTime() you can try it.

I have tried this feature it returns 00:00:00


Diogo Olival wrote:

Imraan Ismail wrote:

Manish Jawla wrote:

Hi Imraan,

Can you please share what exact value you are getting from your DB or some examples so that we can help you in that?

Regards,

MJ

The Value from the DB is something like 60(long integer type to cater for longer values in future), I want to convert that value into a time format(HH:MM). I want to use it to give a total time in a readable format instead of something like 120, I would like it to display as 02:00


Hello,

If your output from the DB is in seconds you can simply create a new date time from a null date, increment the seconds to the date format it as you wish.

Eg.:

FormatDateTime(AddSeconds(NullDate(),120),"mm:ss")

  

Regards,

DO

Will give it a go 


Hi Imraan,

Diogo is right. you can create a null date and add second and then format it . but you need to handle that second should not more than 86400 otherwise it would treat as next date

@Amol TextToTime() function only type cast the text to time 

Regards

Devendra



Solution

i use a foreach

with a custom server action build like this

This outputs as a Text which can then be formatted anyway an if you need to do a calculation just use your original long integer and rerun it though this custom action to return a text its better for visuals in text format and can also be added like a normal int 

Solution

Sorry this is the action

If your issue is resolved, please mark the solution.