fill the string with 0
parent
92b975c93c
commit
4d8aa26574
|
@ -157,6 +157,18 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region IMapImageGenerator Members
|
#region IMapImageGenerator Members
|
||||||
|
public static string fillInt(int _i, int _l)
|
||||||
|
{
|
||||||
|
String _return = _i.ToString();
|
||||||
|
|
||||||
|
while(_return.Length < _l)
|
||||||
|
{
|
||||||
|
_return = 0 + _return;
|
||||||
|
}
|
||||||
|
|
||||||
|
return _return;
|
||||||
|
}
|
||||||
|
|
||||||
public static int getCurrentUnixTime()
|
public static int getCurrentUnixTime()
|
||||||
{
|
{
|
||||||
return (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
|
return (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
|
||||||
|
@ -168,7 +180,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
|
||||||
long unixTimeStampInTicks = (long)(unixTime * TimeSpan.TicksPerSecond);
|
long unixTimeStampInTicks = (long)(unixTime * TimeSpan.TicksPerSecond);
|
||||||
DateTime _date = new DateTime(unixStart.Ticks + unixTimeStampInTicks, System.DateTimeKind.Utc);
|
DateTime _date = new DateTime(unixStart.Ticks + unixTimeStampInTicks, System.DateTimeKind.Utc);
|
||||||
|
|
||||||
return _date.Day + "." + _date.Month + "." + _date.Year + " " + _date.Hour + ":" + _date.Minute;
|
return fillInt(_date.Day, 2) + "." + fillInt(_date.Month, 2) + "." + fillInt(_date.Year, 4) + " " + fillInt(_date.Hour, 2) + ":" + fillInt(_date.Minute, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeDateOnMap(ref Bitmap _map)
|
private void writeDateOnMap(ref Bitmap _map)
|
||||||
|
|
Loading…
Reference in New Issue