Jump to content
Martin Stevnhoved

Date/time formatting and timezones

Recommended Posts

Hi,

 

When a plugin returns a datetime (eg. in a simpleitem) it is formatted acording to the agent device language and timezone.

Is it somehow possible to format/convert it so it match the mobile apps regional setting and timezone?

 

Br, Martin.

Share this post


Link to post
Share on other sites

Hi Martin,

SimpleItem is like a label, it will render the text exactly as you send it. If you want the datetime to be local you to the mobile app you could use the DateTimePicker instead (even if you just want to show it).

-Paul

Share this post


Link to post
Share on other sites

Hi Paul.

Perhaps you could give me a quick example.

I have the same challenge with DateTimeInputItem.

System.DateTime datelocal = System.DateTime.Now;
System.DateTime dateutc = datelocal.ToUniversalTime();

Groups result = new Groups();
Group group = new Group("More Information");
group.Items.Add(new DateTimeInputItem("local", datelocal.ToString()));
group.Items.Add(new DateTimeInputItem("utc", dateutc.ToString()));
result.Add(group);

When running the above on a server in UTC+8 and showing it on a mobile device in UTC+1 it gives me the attached result.

I would like a function that converts the time to the mobile device Time Zone.

Annotation 1 is my phones local time (UTC+1)
Annotation 2 is the servers local time (UTC+8)
Annotation 3 is the servers universal time (UTC)

Br, Martin.

 

 

2016-11-12 13_44_25-2016-11-12 13.38.21.png

Share this post


Link to post
Share on other sites

Hi Martin,

You are correct, sorry for the confusion. We don't support timezone conversion for plugin labels however this would be a great addition so we will definitely consider it for a future release.

-Paul

Share this post


Link to post
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

  • Similar Content

    • By Finzsoft
      I am trying to upgrade some software using PowerShell and I am not sure if my parameters are correctly formatted .  See highlighted text
       
      # Silent Install Secure Secure Authentication
      # http://repository.eset.com/v1/com/eset/apps/business/esa/windows/v2/2.7.32.0/esa_nt64_enu.msi
      # Path for the workdir
      $workdir = "c:\scripts\"
      # Check if work directory exists if not create it
      If (Test-Path -Path $workdir -PathType Container)
      { Write-Host "$workdir already exists" -ForegroundColor Red}
      ELSE
      { New-Item -Path $workdir  -ItemType directory }
      # Download the installer
      $source = "http://repository.eset.com/v1/com/eset/apps/business/esa/windows/v2/2.7.32.0/esa_nt64_enu.msi"
      $destination = "$workdir\esa_nt64_enu_v2.msi"
      # Check if Invoke-Webrequest exists otherwise execute WebClient
      if (Get-Command 'Invoke-Webrequest')
      {
           Invoke-WebRequest $source -OutFile $destination
      }
      else
      {
          $WebClient = New-Object System.Net.WebClient
          $webclient.DownloadFile($source, $destination)
      }
      Invoke-WebRequest $source -OutFile $destination
      # Start the installation
      msiexec.exe /i "$workdir\esa_nt64_enu_v2.msi" ADDLOCAL="Credential_Provider" /qb /L*v "c:\esa_install_log.txt"
      # Wait XX Seconds for the installation to finish
      Start-Sleep -s 35
      # Remove the installer
      rm -Force $workdir\esa_nt64*
    • By Basil62
      Hello and good day. Is there any way for Pulseway to notify me when the monitored system reaches a specific % threshold of RAM or CPU usage?
    • By dpbklyn
      Is there a way to kick off an automated task based on a notification or alert.  For Example, if we get a notification of a disk getting full, I would want the automation to run: 
      <Open a ticket>--> <add predetermined note>--> <add 15 minutes>--><run task to clean drive>--><send notification that task has completed>--><close ticket>
      Is this possible now, or should this be a feature request?
      Thank you,
      dp
    • By Basil62
      I want a program to always run on my computer. Is there a script that forces a program to restart after its process has been stopped?
      Thanks in advance
    • By dpbklyn
      Is there a way to exclude a particular disk (e:\) from the storage notifications?
×