Jump to content

capturing and displaying time and date


Gary@ADL

Recommended Posts

Hi Guys , we have a process where during the pro-cap stage you are asked via customised form to input a time/date - using the time/date control box,

 

we are then trying to output the time / date selected into an email, but the format comes out like - 2017-03-28T23:00:00.000Z

 

is there any way we can amend how the time / date  is stored in the database or outputs on emails?

 

thanks

Capture.JPG

Link to comment
Share on other sites

@Gary@ADL Not 100% sure I can help you but worth a shot. Could you show us the template you used?

Also, might sound stupid but I think you may have a typo in your template. Shouldn't it read "Affected users" instead of "Effected users"? (row 3 in your table)

Link to comment
Share on other sites

It would seem not. Dates in email template

It's frustrating as you need the date in UTC format if you want to use it as a variable but then it looks pants in the email. In the end we decided the email was more important. I've replaced the date/time control with a single line text box and use a regex expression to validate the data entry.

Regards

Doug

Link to comment
Share on other sites

Hi @Gary@ADL,

I used to administer a Planet Press implementation where Regex was virtually essential! You can make date validation incredibly complicated but I'm using

(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)/d/d

This validates dd/mm/yyyy where dd is 01 through 31. mm is 01 through 12 and year is 1900 to 2099. It doesn't check for leap years or the wrong number of days in a month. Good enough for us.

I've not bothered validating times so anything can be added after the date. e.g. "13/04/2017 all day" or "21/04/2017 am only" or "21/04/2017 10:00am". It's not too difficult to write a regex to validate a time though.

Regards

Doug

Link to comment
Share on other sites

@Gary@ADL Thanks for the template, it confirms my suspicions. Because you are storing the date into what is essentially a simple text field in the database, I do not believe you will be able to "transform" this field with dates into a readable format. Although I am not an expert in Hornbill, I can only see 1 option: Change the control type in the progressive capture or form to a simple textbox and ask people to enter manually a date ( / time) and validate using a reg exp. As @DougA mentioned, it is pretty easy thing to validate. Also, Google is full of examples :)

Once you have changed this, you should be able to have more user friendly date time on your email without changing the template.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...