Date Class is lacking

Back to the original question - might be a bit late - but here we go.
I needed fractional seconds on the Mac and my workaround is to call python. This gives you all the formating possibilities you can think off.

Function datetime() as string
dim s as new shell
s.execute(“python -c ““from time import time,strftime;print strftime(’%F %T’)+str(time()%1)[1:4]”””) // use phyton to get fractions of seconds
return s.result.replace(chr(10)," ")

or just grab the date delta class I wrote years ago

Norman, am I overlooking something? I don’t get fractional seconds (miliseconds) nor any easy formating from deltaTime. It make calculation with time nice and easy.

[quote=16874:@Emile Schwarz]You wrote:

(even simply things like getting a zero-padded day or month number aren’t easily achievable)

Dim DR As New Date
Dim DayStr As String

// Because today is 27, I have to change that to less than 10 (1 number)
DR.Day = 5

// Place the day into a string
DayStr = DR.Day

// Now eventually add a leading 0
If Len(DayStr) = 1 Then
DayStr) = “0” + DayStr
End If
// Same apply to month

Isn’t it easy ?

Can you be more specific about other “lackings”[/quote]

or do a format(dr.day,“00”)

It was intended to simply make dealing with the calculation of the deltas between dates etc easy with the formatting left up to who ever uses it

It’s all source code so you can / could modify it to add whatever formatting you want

or dr.SQLDate.Mid(9)

Just testing.

Sascha, what did the mid(9) do??