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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date format

Status
Not open for further replies.

fretn

Programmer
Joined
Jan 10, 2002
Messages
6
Location
BE
hello,<br><br>in my data base there's a date like this =&gt; 8/1/00<br><br>how can i change this with asp to 1st august 2000???<br><br>thanks
 
There are several functions to manipulate dates in asp.<br>try this: <br><br>Dim dDate<br>dDate = CDate(the data from your database)<br><br>Year(dDate) 'returns the year of &lt;date&gt;: 2000<br>Month(dDate) 'returns the month of &lt;date&gt;: 8<br>Day(dDate) 'returns the dat of &lt;date&gt;: 1<br><br>I would write a function that would do all of these things, especially if you want the day and month in string format.<br> <p>ray<br><a href=mailto:rheindl@bju.edu>rheindl@bju.edu</a><br><a href= > </a><br>
 
What type of Database are you using?&nbsp;&nbsp;If it is SQL Server, use the CONVERT function to convert the date into the format you want.<br><br>See Books Online for more info on CONVERT.<br><br>You will probably want to use the style 106 which will convert to &quot;dd mon yy&quot;<br><br>Most DBMS's will provide their own alternative to SQL's Convert so if you are using Oracle, check OraDoc.<br><br>If this option isn't available to you, then your best bet would be to parse it yourself. <p> Jeff Friestman<br><a href=mailto: jfriestman@hotmail.com> jfriestman@hotmail.com</a><br><a href= View my Brainbench transcript</a><br>Brainbench 'Most Valuable Professional' for ASP<br>
Brainbench 'Most Valuable Professional' for JavaScript<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top