Hi
Summary:
- Script will take 2 arguments
- Argument 1: Date/Time value in a particular format
- Argument 2: TimeZone value
Examples:
Argument 1:
a. "May 11, 2012 08:00:00 AM"
b. "Dec 21, 2012 12:21:12 PM"
c. "Oct 2, 2012 05:00:00 PM"
Argument 2:
a. MT or MST or MDT
b. ET
c. PT or PCT
d. GMT / UTC
e. CT
d. IST
Where MT is Mountain time, ET is Eastern Time, PT Pacific Time, GMT is Greenwich Mean Time, CT Central time, IST Indian Standard Time... etc etc.
-----------
Now,
What I need is a BASH script to do the following:
The script will take Argument 1 and Argument 2 and convert the Date/Time in the same Date/Time format to GMT time zone.
i.e.
A.
If I'm entering:
$ Script.sh "May 12, 2012 10:00:00 AM" MT
then,
script should return me GMT value as:
"May 12, 2012 04:00:00 PM"
NOTE: In Daylight/Standard time period, this value can
change.
B.
If I'm entering:
$ Script.sh "May 12, 2012 10:00:00 AM" ET
then,
script should return me GMT value as:
"May 12, 2012 02:00:00 PM" or
-- whatever is the correct value for this ET is for GMT
time zone.
C.
If I'm entering:
$ Script.sh "May 12, 2012 11:00:00 PM" IST
then,
script should return me GMT value as:
"May 12, 2012 05:30:00 PM"
as IST is +5h:30m ahead of GMT.