Code: Alles auswählen
Procedure.s ampm(yy, mm, dd, hh, ii, ss)
If Date(yy,mm,dd,hh,ii,ss)<0
ProcedureReturn FormatDate("%yyyy.%mm.%dd %hh:%ii:%ss",Date(yy,mm,dd,hh,ii,ss))
Else
If Date(yy,mm,dd, hh,ii,ss)>=Date(yy,mm,dd, 0,0,0) And Date(yy,mm,dd, hh,ii,ss)<Date(yy,mm,dd, 12,0,0)
m.s="AM"
Else
m.s="PM"
EndIf
If hh%12=0: hh=12: Else: hh=hh%12: EndIf
ProcedureReturn RSet(Str(hh), 2, "0")+":"+RSet(Str(ii), 2, "0")+":"+RSet(Str(ss), 2, "0")+" "+m
EndIf
EndProcedure
Debug ampm(2009, 12, 5, 23,59,59)
Debug ampm(2009, 12, 5, 00,00,00)
Debug ampm(2009, 12, 5, 01,00,00)
Debug ampm(2009, 12, 5, 11,59,59)
Debug ampm(2009, 12, 5, 12,00,00)
Debug ampm(2009, 12, 5, 13,00,00)
Debug ampm(2009, 12, 5, 24,00,00)
Thread sollte man auch verschieben...