Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var day_date:Date = new Date();
- var day = day_date.getUTCDay();
- var days_of_the_week = new Array("sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday");
- function getDay()
- {
- var _loc1 = days_of_the_week[day];
- return(_loc1.toUpperCase());
- }
- this.onEnterFrame = function()
- {
- time = new Date();
- var minutes = time.getUTCMinutes();
- var hours = time.getUTCHours();
- hours = hours - 7;
- if (hours < 0)
- {
- var mynew_date:Date = new Date();
- var daynew = mynew_date.getUTCDay();
- var daymaths = daynew - 1;
- var date_day = getDay(daymaths);
- var newhours = hours + 1;
- hours = 23 + newhours;
- }
- if (hours < 10)
- {
- hours = "0" + hours;
- }
- if (minutes < 10)
- {
- minutes = "0" + minutes;
- }
- if (hours >= 12)
- {
- var ampm = "PM";
- var hours = hours - 12;
- }
- else if (hours > 12)
- {
- var hours = hours - 12;
- }
- else if (hours = "00")
- {
- var hours = 12;
- var ampm = "AM";
- }
- else
- {
- var ampm = "AM";
- }
- trace(ampm);
- trace(hours + ":" + minutes);
- trace(date_day.toUpperCase());
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement