public int sceRtcGetCurrentClockLocalTime(ScePspDateTime *time) { throw (new NotImplementedException()); /* ulong currentTick; sceRtcGetCurrentTick(¤tTick); sceRtcSetTick(time, ¤tTick); return 0; */ }
public int sceRtcGetCurrentClock(out ScePspDateTime DateTime, int TimeZone) { PspRtc.Update(); var CurrentDateTime = PspRtc.CurrentDateTime; PspRtc.Update(); DateTime = new ScePspDateTime() { Year = (ushort)CurrentDateTime.Year, Month = (ushort)CurrentDateTime.Month, Day = (ushort)CurrentDateTime.Day, Hour = (ushort)CurrentDateTime.Hour, Minute = (ushort)(CurrentDateTime.Minute + TimeZone), Second = (ushort)CurrentDateTime.Second, Microsecond = (uint)(CurrentDateTime.Millisecond * 1000), }; return 0; }
public int sceRtcSetTick(ScePspDateTime* Date, ulong* Ticks) { try { *Date = ScePspDateTime.FromDateTime(new DateTime((long)(*Ticks * 10))); return 0; } catch (Exception Exception) { Console.Error.WriteLine(Exception); return -1; } }
public int sceRtcGetWin32FileTime(ScePspDateTime DateTime) { return 0; }
public int sceRtcGetTime_t(ref ScePspDateTime DateTime, out uint UnixTime) { UnixTime = (uint)DateTime.ToUnixTimestamp(); return 0; }
public int sceRtcGetTime64_t(ref ScePspDateTime DatePointer, ref long UnixTimePointer) { UnixTimePointer = DatePointer.ToUnixTimestamp(); return 0; }
public int sceRtcGetTick(ScePspDateTime* Date, ulong* Tick) { try { *Tick = (ulong)Date->ToDateTime().GetTotalNanoseconds(); return 0; } catch (Exception Exception) { Console.Error.WriteLine("sceRtcGetTick.Date: " + *Date); Console.Error.WriteLine(Exception); return -1; } }
public int sceRtcGetCurrentClock(out ScePspDateTime DateTime, int TimeZone) { PspRtc.Update(); var CurrentDateTime = PspRtc.CurrentDateTime; CurrentDateTime += TimeSpan.FromMinutes(TimeZone); PspRtc.Update(); DateTime = new ScePspDateTime() { Year = (ushort)CurrentDateTime.Year, Month = (ushort)CurrentDateTime.Month, Day = (ushort)CurrentDateTime.Day, Hour = (ushort)CurrentDateTime.Hour, Minute = (ushort)(CurrentDateTime.Minute), Second = (ushort)CurrentDateTime.Second, Microsecond = (uint)(CurrentDateTime.GetTotalMicroseconds() % 1000000), }; return 0; }
public int sceRtcSetTick(ScePspDateTime* date, ulong* tick) { throw (new NotImplementedException()); /* date.parse(*tick); return 0; */ }
public int sceRtcGetTick(ScePspDateTime* date, ulong* tick) { throw (new NotImplementedException()); /* try { *tick = date.tick; return 0; } catch { *tick = 0; return -1; } */ }
public int sceRtcGetWin32FileTime(ScePspDateTime* DateTime, ulong* Win32Time) { return 0; }
public int sceRtcGetTick(ScePspDateTime* Date, ulong* Tick) { try { *Tick = (ulong)Date->ToDateTime().GetTotalNanoseconds(); return 0; } catch (Exception) { //Console.Error.WriteLine("sceRtcGetTick.Date: " + *Date); //Console.Error.WriteLine(Exception); throw (new SceKernelException(SceKernelErrors.ERROR_INVALID_VALUE)); } }
public int sceRtcSetTime_t(out ScePspDateTime date, uint time) { date = ScePspDateTime.FromDateTime(DateTimeRange.ConvertFromUnixTimestamp(time)); return 0; }