Xojo.Core.Date.Constructor(year As Integer, month As Integer, day As Integer, hour As Integer = 0, minute As Integer = 0, seconds As Integer = 0, nanoseconds As Integer = 0, timezone As TimeZone)

From Xojo Documentation

You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!

Constructor

Xojo.Core.Date.Constructor(year As Integer, month As Integer, day As Integer, hour As Integer = 0, minute As Integer = 0, seconds As Integer = 0, nanoseconds As Integer = 0, timezone As Xojo.Core.TimeZone)

Creates a new date using the supplied values. Use this method to create a specific date.

Sample Code

Create a new date for Aug 1, 2015:

Var d As New Xojo.Core.Date(2015, 8, 1, Xojo.Core.TimeZone.Current) // Aug 1, 2015

Create a new date for Sep 1, 2015 at 3:20pm (and 30 seconds):

Var d As New Xojo.Core.Date(2015, 9, 1, 15, 20, 30, 0, Xojo.Core.TimeZone.Current)

Convert a Classic Date to Xojo.Core.Date:

Var d As New Date(2015, 10, 15)
Var xcd As New Xojo.Core.Date(d.Year, d.Month, d.Day, Xojo.Core.TimeZone.Current)