Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Strip comma from date
Old 02-22-2005, 11:10 AM Strip comma from date
netcrawler's Avatar
Average Talker

Posts: 27
Location: QC, Canada
Trades: 0
Hello I have a simple script to output the date from a database to a webpage, I added a LCID value to it so the date would be in french format but unfortunately i need to remove the comma from it how can I do that?

Here is the code:

<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT>

function DoDateTime(str, nNamedFormat, nLCID)
dim strRet
dim nOldLCID

strRet = str
If (nLCID > -1) Then
oldLCID = Session.LCID
End If

On Error Resume Next

If (nLCID > -1) Then
Session.LCID = nLCID
End If

If ((nLCID < 0) Or (Session.LCID = nLCID)) Then
strRet = FormatDateTime(str, nNamedFormat)
End If

If (nLCID > -1) Then
Session.LCID = oldLCID
End If

DoDateTime = strRet
End Function

</SCRIPT>

<td width="110" class="table-qrcadet">&nbsp;<%= DoDateTime((RsForms.Fields.Item("DateUpdated").Val ue), 1, 3084) %></td>

This is the format it comes out as:

1 mars, 2004

I need it to be in this format:

1 mars 2004 ----> no commas.

Thanks.
netcrawler is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-23-2005, 10:11 AM
ACW
Average Talker

Posts: 26
Trades: 0
In my tests - using Date() - I get no commas. But if the source date has a comma it keeps it. If you want to remove any commas you can just use the replace command.
Code:
DoDateTime = Replace(strRet, ",", "")
__________________

Please login or register to view this content. Registration is FREE
by Geo Redundant Hosting
ACW is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Strip comma from date
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.33928 seconds with 12 queries