|
|
Date and Time
ASP » Tips and Tutorials » Date and Time
A D V E R T I S E M E N T
Want free Oracle Magazine? Apply here now!
JScript Examples : setDate Method - FreeFollowing example displays usage of setDate method in JScript. 'setDate methods sets the numeric date of the Date object using local time. VBScript Examples : DatePart Function - FreeDatePart function is a very useful function to get the a part of a date. You may get year, month, day of year .. etc. of a specific date. Formating Date and TimeIn this source code, you may see how can you display date in diffrent formats. This simple ASP code displays current time in short, long and regional settings. WeekDayDiff Function - FreeA function I recently had need of to calculate the difference in days between two weekday dates, without counting days which fall on a weekend. Using DateDiff function in SQL StatementYou may use DateDiff function in an SQL statement to get the number of date and/or time between two dates. You may calculate days between two different date. The return number of DateDiff function can be year, month, day, hour, minute, second .... Using GetDate Function in an SQL StatementThis function is very useful, if you wish to get date of current SQL server date and time. You may use this function to fill some rows automatically with current time or using with DateDiff function to return the number between current time.
Returning Month of Date in an SQL TableThis is an useful but not known functions. If you wish to learn month of date stored in a database, you may use this function placing in a 'SELECT' sql statement Time based Greeting - FreeThis sample ASP code can be used to give your visitors a time-based greeting, for instance if it's 9:00am your message can say "Good Morning". Time Formatting with Now()I will teach you how to use the Now() command and display it 24 times and all of them be different.
Example: use the Now() command and get Monday, 1 July, 2003. Playing With DatesThere are several different ways of displaying dates. You can also add and subtract from them as well. Using the FormatDateTime function we can display dates in any manner. Playing With TimesThere are several different ways of displaying times. Using FormatDateTime and DatePart functions we can manipulate the time in many different ways. Compare datesSelf explaining sort scripts to compare dates. You may use them to display your age, time period fromm a given date or happening etc. (DateDiff, Timer) Displaying Date, Time, and TextShows the basic methods to display date, time and text in a ASP script. Examples on different ways to display the date and time presented. Date Last Modified ScriptWriterThe author writes "Many places on the web feature the date that the current document was last modified on. Rather than changing the date manually, using a FrontPage WebBot, or targeting the document by writing it directly into the script, let the server ask the document for the info and it will tell you. This scriptwriter will output code that can be placed on any .asp document on your server and will display the date and time it was last modified in a number of varieties." Dates & Times - Usage & FormattingDealing with dates, especially in anything other that US standard format, can be a challenge. This tutorial discusses the scripting needed to handle them properly for a range of applications. It also lists reference for each date/time function. Form Dates - FreeThere are a number of ways to have users input dates into your application. Dropdown menus are the preferred method employed as there
will certainly be less error checking on dropdown input as compared to textbox
input. Utilizing the date() functions the current date (or any date you prefer by adjusting the date value) can easily be made the pre-filled selected
value. Here you will find two examples: one that displays the current date with a range of days prior, and the other that displays the current date out of all the dates in a range
of years.
|
A D V E R T I S E M E N T
|
Subscribe to SourceCodesWorld - Techies Talk |
| |
|