Answers for "convert to timezone in code"

1

get date by timezone java

Date date = new Date();
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

// Use Madrid's time zone to format the date in
df.setTimeZone(TimeZone.getTimeZone("Europe/Madrid"));

System.out.println("Date and time in Madrid: " + df.format(date));
Posted by: Guest on July-23-2020
0

convert datetime to user timezone c#

var utcTime = DateTime.UtcNow; // utc
var localTime = utcTime.ToLocalTime(); // users local time
Posted by: Guest on September-10-2020

Code answers related to "convert to timezone in code"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language