I’m not a programmer, but I developed a small company website in Visual Studio. I want to display the date — in specific culture format — on the master pages. I have this at the top of one of my regular aspx pages:
<%@ Page Title="USS Vision Control Panel Build" Language="VB" MasterPageFile="~/Services/Services.Master" AutoEventWireup="false"
CodeFile="controlpanels.aspx.vb" Inherits="controlpanels" culture="auto" meta:resourcekey="PageResource1" uiculture="auto" %>
I’ve followed a lot of ASP tutorials on the web, and the only code that has displayed properly on my page is the following:
<p><%= DateTime.Now.ToString() %></p>
The above-code results in this:
1/18/2012 5:17:36 AM
The problem is that I’m in USA Eastern time, and the time came out in Pacific time. I think I don’t want it to include the time, since the time is static and it’s the wrong time zone, and it’s not updating, second by second. So in summation, I think I’d rather just include the date. It seems more professional for my site.
Does anybody know what I can do to resolve this?
Thank you for any help you can offer!
Jason Weber
This will get you the current date without time.
Running it produces the output:
1/18/2012