|
-
May 16th, 2012, 01:26 PM
#1
Thread Starter
Member
Help With Date Please
I just need to display "today's date" in one of my textboxes that is readonly in the form of "mm/dd/yyy" and I have no clue how to do so. Please help, thank you
-
May 17th, 2012, 12:35 AM
#2
Re: Help With Date Please
Try this way:
Code:
<script type="text/javascript">
var d = new Date();
var curr_date = d.getDate();
var curr_month = d.getMonth() + 1; //months are zero based
var curr_year = d.getFullYear();
document.write(curr_date + "/" + curr_month + "/" + curr_year);
</script>
getDate(): Returns the date
getMonth(): Returns the month
getFullYear(): Returns the year
Source: http://stackoverflow.com/questions/1...-in-javascript
If my post was helpful to you, then express your gratitude using Rate this Post. 
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|