How to get time zone in different programming languages?
Today in this topic we'll cover how you can get time zone in different programming languages.
Get Timezone in PHP
The function that is being used in PHP to get timezone is
date_default_timezone_get()
This function does not take any parameter and returns a string value for example if I'm in London and I'll run this function as date_default_timezone_get() this will return this string Europe/London
Get Timezone in Javascript
If you're using javascript and you want to get default timezone you'll have to run this function to get default timezone
var d = new Date();
var n = d.getTimezoneOffset();
This is very easy to get timezone in different languages.
How to get time zone in different programming languages?
Reviewed by Awais
on
17:33
Rating: