![]() |
Re: The Date object in Jsp
This is not JSP, it's JavaScript!
|
Re: The Date object in Jsp
Quote:
|
Re: The Date object in Java Script
hi, this code can be for calender?
i mean its the same code for the calender? cuz i want 2 put a calender in my project for the check in date and check out, is that code is the right code for that or not? rhnx :) |
Re: The Date object in Java Script
You can make a calendar, using JavaScript but this is not a calendar!
You'll find a lot of ready-to-use calendars at www.dynamicdrive.com |
Re: The Date object in Java Script
thanks even i need to work with dates and times
|
Re: The Date object in Java Script
good script, can you share a script for displaying scrolling tect in vertical motion as i am finding it but still i don't get it , kindly help me
|
Re: The Date object in Java Script
Describes the JavaScript Date Object including properties, constructors, and methods.
Properties * prototype - For creating more properties. Constructors * Date() - Use the current date and time to create an instance of the object date. * Date(dateString) - Use the date specified by the string to create the instance of the date object. String format is "month day, year hours:minutes:seconds". * Date(year, month, day) - Create an instance of date with the specified values. Year is 0 to 99. * Date(year, month, day, hours, minutes, seconds) - Create an instance of date with the specified values. Methods * getDate() - Get the day of the month. It is returned as a value between 1 and 31. Code:
var curdate = new Date()The above code prints the day of the month. # getDay() - Get the day of the week as a value from 0 to 6 Code:
var curdate = new Date()The above code prints the day of the week. # getHours() - The value returned is 0 through 23. Code:
var curdate = new Date()The above code prints the hours since midnight. # getMinutes() - The value returned is 0 through 59. Code:
var curdate = new Date()The above code prints the minutes past the hour. # getMonth() - Returns the month from the date object as a value from 0 through 11. Code:
var curdate = new Date()The above code prints the numeric value of the month. # getSeconds() - The value returned is 0 through 59. Code:
var curdate = new Date()The above code prints the seconds since the last minute. # getTime() - The number of milliseconds since January 1, 1970. this function allows you to manipulate the date object based on a millisecond value then convert it back to the form you want. In the example below, it is used to set a future expiration time of a cookie. Code:
var futdate = new Date()Code:
var curdate = new Date()The above code prints the number of hours different between your timezone and GMT. This value may change with daylight savings time.. # getYear() - Returns the numeric four digit value of the year. Code:
var curdate = new Date()The above code prints the numeric value of the year which is currently 2000. # parse() - The number of milliseconds after midnight January 1, 1970 till the given date espressed as a string in the example which is IETF format. Code:
var curdate = "Wed, 18 Oct 2000 13:00:00 EST"# setHours(value) - Set the hours in the date object with a value of 0 through 59. # setMinutes(value) - Set the minutes in the date object with a value of 0 through 59. # setMonth(value) - Set the month in the date object as a value of 0 through 11. # setSeconds(value) - Set the seconds in the date object with a value of 0 through 59. # setTime(value) - Sets time on the basis of number of milliseconds since January 1, 1970. The below example sets the date object to one hour in the future. Code:
var futdate = new Date()# toGMTString() - Convert date to GMT format in a form similar to "Fri, 29 Sep 2000 06:23:54 GMT". Code:
var curdate = new Date()Code:
Wed, 18 Oct 2000 18:08:11 UTC# UTC() - Based on a comma delimited string, the number of milliseconds after midnight January 1, 1970 GMT is returned. The syntax of the string is "year, month, day [, hrs] [, min] [, sec]". An example is "2000, 9, 29, 5, 43, 0" for Sept 29, 2000 at 5:43:0. The string is considered to be GMT. The hours, minutes, and seconds are optional. Code:
document.write(Date.UTC(2000, 9, 29, 5, 43, 0) + " |
Re: The Date object in Java Script
such a nice trickes really good thank you so much
|
| All times are GMT +5.5. The time now is 10:26. |