DateTime.setDate C# (CSharp) Méthode

setDate() public méthode

public setDate ( int year, int month, int day ) : object
year int
month int
day int
Résultat object
    public virtual object setDate(int year, int month, int day)
    {
        try
        {
            var time = TimeZoneInfo.ConvertTime(Time, TimeZone);
            this.Time = TimeZoneInfo.ConvertTime(
                new System_DateTime(
                    year, month, day,
                    time.Hour, time.Minute, time.Second,
                    time.Millisecond
                ),
                TimeZone
            );
        }
        catch (ArgumentOutOfRangeException e)
        {
            throw new ArgumentOutOfRangeException(string.Format("The date {0}-{1}-{2} is not valid.", year, month, day), e);
        }


        return this;
    }