Asia/ho_chi_minh: time zone in vietnam, current local time

     

*

Introducing: Trending sort You can now choose lớn sort by Trending, which boosts votes that have happened recently, helping khổng lồ surface more up-to-date answers.

Bạn đang xem: Asia/ho_chi_minh: time zone in vietnam, current local time

Trending is based off of the highest score sort và falls back to it if no posts are trending.

Try it Dismiss
Highest score (default) Trending (recent votes count more) Date modified (newest first) Date created (oldest first)
You need to insert with mysql date time format. In PHP which is equivalent to,

date("Y-m-d H:i:s")Note: Issue is not related to Time Zone, but you can set mặc định time zone lớn Singapore using date_default_timezone_set("Asia/Singapore"); on top of your file.


*

date_default_timezone_set("Asia/Singapore");look at this for default_time_rimezone

to get the timezone.


*

There are two methods to lớn display current timestamp. Either you use "localtime" PHP method lớn display the current local time in an Array OR you can use DateTimeZone khổng lồ display the specific timezone date-time. Here is the code ..

Xem thêm: Trực Tiếp Hoa Hồng Trên Ngực Trái Tập 21 Vtv3 Full Hd 16/10 Trên Vtv Giải Trí

setTimezone($to);echo $currDate->format("Y/m/j H:i:s");?>

*

*

write date_default_timezone_set("Asia/Singapore"); before displaying the date.

for inputting the value into database, use the date("Y-m-d H:i:s") format in php lớn match the column, or make the column type as varchar(50) khổng lồ store date as string.


You can use this

http://ir2.php.net/manual/en/datetime.construct.php

// Current date/time in the specified time zone.$date = new DateTime(null, new DateTimeZone("Asia/Singapore"));echo $date->format("Y-m-d H:i:sP") . " ";


Thanks for contributing an answer khổng lồ Stack Overflow!

Please be sure lớn answer the question. Provide details and share your research!

But avoid

Asking for help, clarification, or responding lớn other answers.Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.


Post Your Answer Discard

By clicking “Post Your Answer”, you agree lớn our terms of service, privacy policy và cookie policy


Site kiến thiết / hình ảnh sản phẩm © 2022 Stack Exchange Inc; user contributions licensed under cc by-sa. Rev2022.7.13.42580


Your privacy

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device & disclose information in accordance with our Cookie Policy.


Chuyên mục: Domain Hosting