Forum Discussion

JoeTheFifth's avatar
JoeTheFifth
Icon for Altostratus rankAltostratus
Oct 14, 2019

Client browser Date/Time And TimeZone iRule or APM

Anyone has a code snippet for getting the browser datetime and timezone with daylight saving taken into account, please?

I would like to log this info with either an irule or through an apm vpe.

 

I have all this on server side of course but I need to show to the user his last connection information based on his datetime/zone when going through the logon process.

Currently I'm showing this info in GMT based on the server side (LTM) datetime/zone.

If I can find a way of generating an APM variable inside the a decisionbox .inc file by using a javascript code that would be great.

I can get the time zone offset using this code and showing it in a message box (alert inside the inc file) but I haven't found a way of creating/updating an apm variable to be used inside the VPE.

 

<script>

var d = new Date();

var n = d.getTimezoneOffset();

</script>

 

This code does not take into account the daylight saving Time.

 

Or maybe there is something native in APM !!

No RepliesBe the first to reply