Time Format

Questions, problems, and other issues for Ascendis Caller ID that aren't covered by the other forums.
Post Reply
samsungpower
Posts: 49
Joined: Tue May 22, 2012 4:40 pm

Time Format

Post by samsungpower »

Hello, I been trying to figure out how to change the time output display to show in 24 hour format vs 12 hour and failing terribly and need some help.

I see in the display.dwshtml file reference to the time stamp

Code: Select all

<td>
       <if> 0&#41; then
           Send&#40;StringReplace&#40;CallInfo.CallBeganTimeStr, ' ', '&nbsp;', True, False&#41;&#41;
         Else
           Send&#40;'&nbsp;'&#41;;
       %>
      </td>


and also in the websever files

Code: Select all

###TimeStamp###
but haven't able to be successfully understanding how to make it work. I see in the help file section under " Sample Script (DWS - Function Library) "
This sample of keeping common functions in a single file was donated by Brian Larsen. Actions can use the {$INCLUDE} directive to access it.
with examples but not able to fully understand how to make it into CallInfo. string and don't know if I am heading in the right direction either.

Code: Select all

dateTime.hour.h24Str
Bill Root
Site Admin
Posts: 1025
Joined: Mon Jan 19, 2004 1:29 pm
Location: Perrysburg, OH
Contact:

Re: Time Format

Post by Bill Root »

samsungpower wrote:Hello, I been trying to figure out how to change the time output display to show in 24 hour format vs 12 hour and failing terribly and need some help.
One solution is to change the time format in Windows. However, you probably don't want to use 24-hour format in Windows or you would have already done that.

If you're trying to change the time format for the display panel, you can do it using the FormatDateTime function in DWS scripts. For example:

Code: Select all

       <td>
        <% 
          if &#40;CallCount > 0&#41; then 
            Send&#40;FormatDateTime&#40;'hh&#58;nn&#58;ss', CallInfo.CallBegan&#41;&#41;
          Else
            Send&#40;'&nbsp;'&#41;;
        %>
       </td>
The format for the FormatDateTime function is not described in the help, but it is available in many other places, such as http://www.delphibasics.co.uk/RTL.asp?N ... atdatetime.
and also in the websever files

Code: Select all

###TimeStamp###
If you're trying to change it in the web server files, you can't except by changing the Windows time format. The web server uses simple templates that can't contain scripts.
I see in the help file section under " Sample Script (DWS - Function Library) "
This sample of keeping common functions in a single file was donated by Brian Larsen. Actions can use the {$INCLUDE} directive to access it.
Brian Larsen's date/time library predates the DWS Date & Time Library, which is also documented in the help. We recommend using the DWS Date & Time Library instead since it's easier (and faster) for most purposes.


Finest regards,
Bill Root
Ascendis Software LLC
samsungpower
Posts: 49
Joined: Tue May 22, 2012 4:40 pm

Post by samsungpower »

Thanks again and also for the link http://www.delphibasics.co.uk/RTL.asp?N ... atdatetime
this expands my options.
Post Reply