Git Repository Public Repository

CPE_learningsite

URLs

Copy to Clipboard

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package
{
	import mx.formatters.DateFormatter;

	public class Utilities
	{
		public static function randomRange(low:Number, high:Number):int
		{
			return Math.floor(Math.random() * (high - low)) + low;
		}
		
		public static function currentDateTimeString():String
		{               
			var currentDateTime:Date = new Date();
			currentDateTime.minutes += currentDateTime.getTimezoneOffset();
			var currentDF:DateFormatter = new DateFormatter();
			currentDF.formatString = "MM/DD/YY LL:NN:SS A"
			var dateTimeString:String = currentDF.format(currentDateTime);
			return dateTimeString;
		}
		
		public static function datePartString(part:Number):String {
			var result:String;
			
			if(part < 10){
				result = "0" + part.toString();
			}
			else{
				result = part.toString();
			}
			return result;
		}
		
		public static function UTCOffsetString(offset:Number):String{
			var result:String;
			if( offset > 0){
				result = "+";
			}
			else{
				result = "-";
			}
			
			var hours:int = offset / 60;
			var minutes:int = offset % 60;
			
			if(hours < 10){
				result += "0" + hours.toString();
			}
			else{
				result += hours.toString();
			}
			
			if(minutes < 10){
				result +=":0" + minutes.toString();
			}
			else{
				result += ":" + minutes.toString();
			}
			
			return result;
		}
	}
}

Commits for CPE_learningsiteCPEFlex/EngagementPod/src/Utilities.as

Diff revisions: vs.
Revision Author Commited Message
4cd176 ... v.shishlov Fri 27 Aug, 2021 14:33:17 +0000

initial commit