Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.text.SimpleDateFormat;

import java.util.TimeZone;

public class Main {
    public static SimpleDateFormat getStartDateTimeInTimezone(String timezone) {
        SimpleDateFormat format = new SimpleDateFormat("EEEE, MMMM d, h:mm a");
        if (timezone == null || timezone.isEmpty()) {
            format.setTimeZone(TimeZone.getDefault());
        } else
            format.setTimeZone(TimeZone.getTimeZone("GMT+" + timezone));
        return format;
    }
}