Jump to content
  • 0

Convert a number (or text) to time


I have  a field that contains a 24 hour clock time as 4 digits.  It is a start time.  They are number fields (but could be text).  Entered simply as #### (ie 1300)

I would like to populate another hidden field with this number converted to a time value of 13:00.  Ive tried CAST and CONVERT.


I can do it in Excel with several different formulas but I cant find a Capsio equivalent that doesnt error.


Try_Convert(time(0),LEFT([@field:DTN_Start_value],2) +':'+ RIGHT([@field:DTN_Start_value],2))

Any thoughts?



Edited by roattw

Share this post

Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hi @roattw,

You can use the following expression in Caspio:


WHEN Len([@field:YOUR_FILED]) =3 THEN Left([@field:Text],1) +':'+Right([@field:Text],2)

WHEN Len([@field:YOUR_FILED]) > 3 THEN Left([@field:Text],2) +':'+Right([@field:Text],2)


Hope this helps.



Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...