Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Conversion Question - to Oracle 8i Format

Status
Not open for further replies.

CharlieMike73

Programmer
May 17, 2002
120
US
Hi, I have an ASP page and i want to conver the date I obtain from the date() function to an oracle format (dd-mmm-yy (09-Jan-03)).

All help is appreciated.

Thnx
 
oracleDate = Day(date()) & "-" & Month(date()) & "-" & Year(date()) Get the Best Answers! faq333-2924
"A witty saying proves nothing." - Voltaire
mikewolf@tst-us.com
 
Wow - thnx for the fast reply - great job, will try you snippet now! - thnx
 
OOPPS - do you need the month's name?

oracleDate = Day(date()) & "-" & MonthName month(date()), true & "-" & Year(date()) Get the Best Answers! faq333-2924
"A witty saying proves nothing." - Voltaire
mikewolf@tst-us.com
 
Just the first three chars Jan, Feb, Mar...

Trust Oracle to make the date issue difficult from the rest of the world!

Just as well they made up for it in other areas!
 
Here is what I came up with after you showed me about the 'Day(date()) Month(date()) Year(date())' trick!

Dim MM_OracleDate
Dim MM_Month

If Month(date()) = 1 Then MM_Month = "Jan"
If Month(date()) = 2 Then MM_Month = "Feb"
If Month(date()) = 3 Then MM_Month = "Mar"
If Month(date()) = 4 Then MM_Month = "Apr"
If Month(date()) = 5 Then MM_Month = "May"
If Month(date()) = 6 Then MM_Month = "Jun"
If Month(date()) = 7 Then MM_Month = "Jul"
If Month(date()) = 8 Then MM_Month = "Aug"
If Month(date()) = 9 Then MM_Month = "Sep"
If Month(date()) = 10 Then MM_Month = "Oct"
If Month(date()) = 11 Then MM_Month = "Nov"
If Month(date()) = 12 Then MM_Month = "Dec"

MM_OracleDate = Day(date()) & "-" & MM_Month & "-" & Year(date())
 
My second reply accounts for the month name abbreviation.

MonthName monthNumber [, abbreviate]

monthName 1 = "January"
monthName 1,true = "Jan" Get the Best Answers! faq333-2924
"A witty saying proves nothing." - Voltaire
mikewolf@tst-us.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top