When you think ASP, think...
Recent Articles
All Articles
ASP.NET Articles [1.x] [2.0]
ASPFAQs.com
Message Board
Related Web Technologies
User Tips!
Coding Tips
Search

Sections:
Book Reviews
Sample Chapters
Commonly Asked Message Board Questions
Headlines from ASPWire.com
JavaScript Tutorials
MSDN Communities Hub
Official Docs
Security
Stump the SQL Guru!
Web Hosts
XML Info
Information:
Advertise
Feedback
Author an Article
Technology Jobs



















internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers
ASP ASP.NET ASP FAQs Message Board Feedback ASP Jobs
Print this page.

Risk Developer - C# - T-SQL - ASP.Net (IL)
Next Step Systems
US-IL-Chicago

Justtechjobs.com Post A Job | Post A Resume

User Tip: Improving the Custom Date Formatting Function


From Al P.:

Just downloaded and used your custom DanDate() function, but it didn't have any way of illustrating an ordinal number. I've added this functionality to the function, and its below.

%O adds ordinal (th, nd, rd) to a number)

In DanDate() Function Add:
intPosItem = Instr(strFormat, "%O") Do While intPosItem > 0 strFormat = Left(strFormat, intPosItem-1) & Ordinal(DatePart("d",strDate)) & _ Right(strFormat, Len(strFormat) - (intPosItem + 1)) intPosItem = Instr(strFormat, "%O") Loop

Also need to add this:
Function Ordinal(aNum) ord = "th" if aNum = 1 or aNum = 21 then ord = "st" elseif aNum = 2 or aNum = 3 or aNum = 22 or aNum = 23 then ord = "nd" end if Ordinal = ord End Function

Anyway, use it, don't use it. Its up to you. :-)


Windows Internet Technology | ASP.NET [1.x] [2.0] | ASPMessageboard.com | ASPFAQs.com | Advertise | Feedback | Author an Article


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers