Announcement

Collapse
No announcement yet.

How do I get correct time format in emails?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • sparkman
    replied
    Originally posted by Eug View Post
    Oh, even better. The logging was getting annoying, and my searches told me there was no way around it.
    I put in a Bugzilla for it to see if HS can add a way to suppress those as well.

    Cheers
    Al

    Leave a comment:


  • Eug
    replied
    Oh, even better. The logging was getting annoying, and my searches told me there was no way around it.

    Leave a comment:


  • sparkman
    replied
    Originally posted by Eug View Post
    Awesome. Thank you!
    You're welcome. On further review, it will be better to use this function as it generates no log entries:

    Code:
    &hs.SetDeviceString 6372, FormatDateTime(Time,4),True
    &nhs uses a vb.net script and when it generates those, there's an entry in the log every time. Using &hs uses vbscript which does not generate the log entries. The syntax for the vbscript call is a bit different.

    Cheers
    Al

    Leave a comment:


  • Eug
    replied
    Awesome. Thank you!

    Leave a comment:


  • sparkman
    replied
    Originally posted by Eug View Post
    Thanks. Is there some easy way to set a device's status string to the current 24-hour time without learning HS scripting?
    You can create an event to run a single line script. The single line script to use would be:

    Code:
    &nhs.SetDeviceString(6372,DateTime.Now.ToString("HH:mm"),True)
    Run the event once a minute, referenced to the top of the hour and change 6372 to the reference id of your virtual device.

    Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	35.3 KB
ID:	1187238

    Cheers
    Al

    Leave a comment:


  • Eug
    replied
    Thanks. Is there some easy way to set a device's status string to the current 24-hour time without learning HS scripting?

    Leave a comment:


  • sparkman
    replied
    A couple of options that I see are to create a virtual device that holds the time in the format that you want, and the other one is to send the email through a script as you can format the time in the script more easily.


    Sent from my iPhone using Tapatalk

    Leave a comment:


  • Eug
    started a topic How do I get correct time format in emails?

    How do I get correct time format in emails?

    I have some events that send emails and I'm using the $time variable to embed the current time in the email. This comes out in 12-hour format despite my system being configured for 24-hour time and the HS3 web UI showing me 24-hour time.

    How do I get the time in my emails to not be 12-hour?
Working...
X