#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2001
    Location
    USA
    Posts
    195
    Rep Power
    19

    Date formatting help please


    Code:
    <script runat="server" language="javascript">
    
    function Maintenance() {
        var MAINTENANCE_OFFSET = -660; // Make 7am as the start of a new day using UTC
    	var d = new Date();  // current server date time
    	var offset = d.getTimezoneOffset(); // difference in minutes between server time and UTC
    	d.setMinutes(d.getMinutes() + offset + MAINTENANCE_OFFSET);
    	var options = {year: "numeric", month: "2-digit", day: "2-digit" };
    	var n = d.toLocaleDateString("en,GB",options); 
     	return n;
    }
    
    </script>
    
    
    <%
          
            Dim mdate
            mdate=Maintenance()
        	Response.Write mdate
    
    %>
    displays (Thursday, May 28, 2015). I would like it to be (5/28/2015) what am I doing wrong? Thanks jobesd
    I only do what the voices in my head keep telling me to do.
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,553
    Rep Power
    4549
    I don't know the js date functions, you might want to look at javascript documentation or check in the javascript forum.
    ======
    Doug G
    ======
    I've never been able to appreciate the sublime arrogance of folks who feel they were put on earth just to save other folks from themselves .." - Donald Hamilton

IMN logo majestic logo threadwatch logo seochat tools logo