Platforms to show: All Mac Windows Linux Cross-Platform

Back to CFDateMBS class.

CFDateMBS.NewDate(date as date, timeZone as CFTimeZoneMBS = nil) as CFDateMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreFoundation MBS MacCF Plugin 19.0 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates a Xojo date from CFDate with given time zone.
Example
// Xojo now
dim d as new date
// convert to CFDate in UTC
dim c as CFDateMBS = CFDateMBS.NewDate(d, nil)
// and convert back
dim x as date = c.Date(nil)

// compare in debugger
dim ds as string = d.SQLDateTime
dim dx as string = x.SQLDateTime

// and with current time zone
dim dx2 as string = c.Date(SystemCFTimeZoneMBS).SQLDateTime

Break

If time zone is nil, we use UTC.

See also:

CFDateMBS.NewDate(date as dateTime, timeZone as CFTimeZoneMBS = nil) as CFDateMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreFoundation MBS MacCF Plugin 20.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a Xojo dateTime from CFDate with given time zone.

If time zone is nil, we use UTC.

See also:

CFDateMBS.Now as CFDateMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreFoundation MBS MacCF Plugin 19.0 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates new date object with current timestamp.
Example
dim d as CFDateMBS = CFDateMBS.now
MsgBox d.date.SQLDateTime

The items on this page are in the following plugins: MBS MacCF Plugin.


The biggest plugin in space...