2000-Year Rewind program implemented with ASP

Source: Internet
Author: User
Tags date current time rewind
Using several time functions, the program can simply complete the function of 2000 rewind in ASP Web pages, and change the parameters of CDate function to finish the other date.

The ASP source code is as follows:

< B >2000 Year Rewind!</II >< BR >

' Show Current time
The current time is <%= times ()% > on <%= Date ()% >.< BR >

' Calculate the number of days to display from a specified date
From 2000 there are <%= DateDiff ("D", now (), Cdate
("01/01/2000-00:00:00") % > Days! < BR >

' Calculates the number of hours displayed from a specified date
From 2000 there are <%= DateDiff ("H", now (), Cdate
("01/01/2000-00:00:00") % > H!< BR >

' Calculate the number of minutes from the specified date
From 2000 there are <%= DateDiff ("N", Now (), Cdate
("01/01/2000-00:00:00") % > Min!< BR >

' Calculates the number of seconds to display from a specified date
From 2000 there are <%= DateDiff ("s", Now (), Cdate
("01/01/2000-00:00:00") % > Sec!< BR >
The following is the HTML output:

2000 is a time to remember!

The current time is PM 9:44:34 on 99/11/12.
It's 50 days from 2000!
It's 1179 hours from 2000!
It's 70,696 minutes from 2000!
It's 4,241,726 seconds from 2000!



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.