codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:



Home » ASP » Article

A Better Moustrap: FmtDate to replace FormatDateTime

Article by: Jeremy M (5/15/2004)
Bookmark us now! Add to Favourites
Email a friend! Tell a friend
Sponsored by: FindMyHosting - Web Hosting Search
Summary: An example of a simple-to-use replacement for the visual basic script function FormatDateTime.
Viewed: 5146 times Rating (18 votes): 
 4.2 out of 5
  Rate this Article   Read Comments   Post Comments

A Better Moustrap: FmtDate to replace FormatDateTime



Have you ever been frustrated with the lack of options with visual basic script's built in function FormatDateTime? If so, then this function is for you- and it demonstrates how simple it is to build very complex search-and-relace functions.

Once you've added the two functions below to your ASP or VBS file, you can call the function just like any other function. Two parameters are required, the first is the date/time value you want to re-format, and the second parameter is the format you want. For all the different options you can use in the format, check out the comments at the top of FmtDate.

I'm not the original author of this function, but I've added and changed a lot of it to make it more useful. I've used it and modified so much for so many years, I don't even know where the original version came from.

Here it is, have fun!

example:

Select All Code


returns

Select All Code


Here's the function(s). You need both for it to work properly! FmtDate calls

Select All Code







CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
Rate this article:     Poor Excellent
View highlighted Comments
User Comments on 'A Better Moustrap: FmtDate to replace FormatDateTime'


To post comments you need to become a member. If you are already a member, please log in .

 



RELATED ARTICLES
MagicGrid
by Abhijeet Kaulgud
MagicGrid is an all-in-one grid for ASP programmers. It is a 3 Level Hierarchial Grid. You can Add, Edit, Delete Items under all the three levels. You can also cut-copy-paste Items from one level to other, It happens just by drag & drop!
ASP Format Date and Time Script
by Jeff Anderson
An ASP script showing the variety of date and time formats possible using the FormatDateTime Function.
Creating a Dynamic Reports using ASP and Excel
by Jeff Anderson
A simple way to generate Excel reports from a database using Excel.
ASP Shopping Cart
by CodeToad Plus!
Complete source code and demo database(Access, though SQL compatible) to an ASP database driven e-commerce shopping basket, taking the user through from product selection to checkout. Available to CodeToad Plus! Members
Create an ASP SQL Stored Procedure
by Jeff Anderson
A beginners guide to setting up a stored procedure in SQL server and calling it from an ASP page.
Email validation using Regular Expression
by Jeff Anderson
Using regular expression syntax is an exellent way to thoroughly validate an email. It's possible in ASP.
The asp:checkbox and asp:checkboxlist control
by David Sussman, et al
Checkboxes are similar to radio buttons, and in HTML, they were used to allow multiple choices from a group of buttons.
Creating an SQL Trigger
by Jeff Anderson
A beginners guide to creating a Trigger in SQL Server
Find Visitor Geographical location from IP address using ASP
by Per Soderlind
Where are your internet visitors coming from? Using simple ASP and the free GEOIP Database from Maxmind its quite easy to find out
ASP.NET Forum Source Code
by ITCN
Complete open source website Forum and Discussion Board programmed in Microsoft dot Net 1.1 Framework with Visual Basic.








Recent Forum Threads
•  execute an Excel macro when the sheet is changed from ASP.NET
•  Re: form
•  form
•  Re: Client-Side Progress Window
•  Re: Help: Trouble with z-Index and SELECT lists
•  Here ur answer ........Check it baby
•  MS Access connection in JSP
•  Re: How to associate a button in DataGrid button column with a javascript function (ASP.NET)???
•  Re: DHTML Menu Flashes with StyleSheets applied in IE


Recent Articles
Communicating with the Database (Using ADO)
MagicGrid
Simple Thumbnail Browsing Solution
Type Anywhere
A Better Moustrap: FmtDate to replace FormatDateTime
ASP.NET Forum Source Code
Internal Search Engine
Javascript Growing Window
Simple date validation
Search engine friendly URLs using ASP.NET (C#.NET)


Site Survey
Help us serve you better. Take a five minute survey. Click here!

© Copyright codetoad.com 2001-2005