setHours

Summary

Sets the hours of the System.Date object according to local time.

Usage

public double setHours(int hour)

Returns

The current time value of the System.Date object, which represents the difference in milliseconds from the updated date/time and 1 January 1970 00:00:00:00 UTC.

Parameters

hour

An integer value between 0 and 23 to set the hour to.

Description

Sets the hours of the System.Date object according to local time.

Examples

Basic Usage
1
2
3
4
5
6
import System;
 
Date d = new Date(2011, Date.Month.FEB, 10, 5, 30, 59, 100);
Console.log(d.getHours()); // 5
d.setHours(13);
Console.log(d.getHours()); // 13

Share

HTML | BBCode | Direct Link