convert to timezone in code code example
Example 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));
Example 2: convert datetime to user timezone c#
var utcTime = DateTime.UtcNow; // utc
var localTime = utcTime.ToLocalTime(); // users local time