Formating Time with php variables
-
- Posts: 41
- Joined: Thu Dec 29, 2016 3:18 pm
I am trying to format the Template Variable to show the date in a 24hr format. But when I use the formatting parameters such as %H:%M:%S included in the variable like so: [BOOKINGTIMEDATE: {%H:%M:%S}] the variable doesn't seem to be converting. I had expected the time variables to work like the date variables on the help link about Template Variable but I must be missing some key piece of the syntax.
-
- Posts: 296
- Joined: Wed Dec 28, 2016 2:20 pm
Hi,
You can use [BOOKINGDATE: {%H:%M:%S}] with the formating or [BOOKINGTIMEDATE] without the formatting.
Please check the Template Variable page for the fields that can be formatted : - https://wiki.beds24.com/index.php?title ... _Variables
You can use [BOOKINGDATE: {%H:%M:%S}] with the formating or [BOOKINGTIMEDATE] without the formatting.
Please check the Template Variable page for the fields that can be formatted : - https://wiki.beds24.com/index.php?title ... _Variables
-
- Posts: 41
- Joined: Thu Dec 29, 2016 3:18 pm
Looking at the available variables and the description on the help file I expected the following variable with modifiers to return both the date and time in the form I am making with the custom date template variables as per the description provided:lesleywoermeijer wrote:Hi,
You can use [BOOKINGDATE: {%H:%M:%S}] with the formating or [BOOKINGTIMEDATE] without the formatting.
[BOOKINGDATE: {%a, %e %a, %y, %H:%M:%S}]
But it just showed up as the code above instead. So how do you use the modifiers to show the date AND time?
-
- Posts: 296
- Joined: Wed Dec 28, 2016 2:20 pm
I have just tested your setting [BOOKINGDATE: {%a, %e %a, %y, %H:%M:%S}] and this is the result for my booking page :- Tue, 10 Tue, 17, 14:26:45. Is this not what you are expecting to see?
-
- Site Admin
- Posts: 935
- Joined: Fri Mar 02, 2012 1:43 pm
Make sure there are no HTML codes in your entire template code, it must be pure text.buckinghamhouse wrote:
[BOOKINGDATE: {%a, %e %a, %y, %H:%M:%S}]
But it just showed up as the code above instead. So how do you use the modifiers to show the date AND time?
You can check the content in the editor's source mode to make sure there is no stray content.
-
- Posts: 41
- Joined: Thu Dec 29, 2016 3:18 pm
Got it to work using your input Mark, thank you very much!