Answers for "set timezone"

PHP
12

linux set date timezone

# To view timezone
timedatectl

# list all available timezones
timedatectl list-timezones

# update timezone
sudo timedatectl set-timezone your_time_zone
Posted by: Guest on September-02-2020
-1

php current datettime us time zone

<?php
$date = new DateTime("now", new DateTimeZone('America/New_York') );
echo $date->format('Y-m-d H:i:s');
Posted by: Guest on August-03-2020
0

get timezone

var timedifference = new Date().getTimezoneOffset();
Posted by: Guest on August-10-2021
0

datetime now with timezones

from pytz import timezone
from datetime import datetime

UTC = timezone('Asia/Kolkata')

def time_now():
    return datetime.now(UTC)
    
print(time_now())
Posted by: Guest on July-26-2021
0

get timezone

var timedifference = new Date().getTimezoneOffset();
//This returns the difference from the clients timezone from UTC time. You can then play around with it as you like.
Posted by: Guest on August-10-2021

Browse Popular Code Answers by Language