Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
93 lines (83 loc) · 2.17 KB

File metadata and controls

93 lines (83 loc) · 2.17 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// *************************
// * COPYRIGHT
// * DEVELOPER: MTEAM ( info@mteamapp.com )
// * ALL RIGHTS RESERVED FOR MTEAM
// * YOU CAN'T USE THIS CODE IN ANY OTHER SOFTWARE FOR ANY PURPOSE
// * YOU CAN'T SHARE THIS CODE
// *************************
package
{
import diagrams.calender.MyShamsi;
public class TimeToString
{
/**return the time from seconds to string 10:54*/
public static function timeInString(seconds:Number):String
{
seconds = Math.ceil(seconds);
var min:Number = Math.floor(seconds/60);
seconds = seconds%60;
var hour:Number = Math.floor(min/60);
min = min%60;
if(hour>0)
{
return numToString(hour)+':'+numToString(min)+':'+numToString(seconds);
}
else
{
return numToString(min)+':'+numToString(seconds);
}
}
/**12:105*/
public static function miliSecontToString(milisecond:Number):String
{
var sec:uint = Math.floor(milisecond/1000)
var mil:uint = milisecond-sec*1000;
return sec+':'+mil ;
}
/**1 > 001*/
public static function numToString(num:*,numberLenght:uint=2):String
{
num = String(num);
while(num.length<numberLenght)
{
num = '0'+num;
}
return num;
}
/**1:10 > 70*/
public static function stringToNumBased60(str:String):uint
{
var parts:Array = str.split(':');
var num:uint = 0 ;
for(var i:int = 0 ; i<parts.length ; i++)
{
num *= 60 ;
num += uint(parts[i]) ;
}
return num ;
}
/**Return string in format YYYY/MM/DD HH:MM:SS*/
public static function dateToString(date:Date,showClock:Boolean=false,showSeconds:Boolean=false,showDate:Boolean=true):String
{
var str:String = '' ;
if(showDate)
{
str = date.fullYear+'/'+(date.month+1)+'/'+date.date+' ';
}
if(showClock)
{
str+=numToString(date.hours)+':'+numToString(date.minutes);//
if(showSeconds)
{
str+=':'+numToString(date.seconds);
}
}
return str ;
}
//////////////////////////////
public static function shamsiToTimeLable(shamsi:MyShamsi):String
{
return shamsi.fullYear+numToString(shamsi.month+1)+numToString(shamsi.date)+numToString(shamsi.hours)+numToString(shamsi.minutes)+numToString(shamsi.seconds);
}
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.