Change Date

Apr 1, 2009 at 6:52 PM
Edited Apr 1, 2009 at 6:53 PM
Hi Guys,

I can't find where to change the date in the comments from US to UK , does anyone know.



PS, I love BlogEngine, is there anywhere I can see some examples of what other have done with it to get some idea's.
Apr 1, 2009 at 9:16 PM
On the Settings tab in the Control Panel, there's a "Server time offset" setting.

If you want UK time and your website is on a server in the US, you should put the number of hours difference in that setting (probably somewhere between 4 to 8).  Once you do that, any new comments, posts etc will pick up the new time offset value.  Existing comments will probably still have the old time.

There's lots of BlogEngine websites out there.  A few that come to mind (but there are many many more) are:
Apr 1, 2009 at 10:03 PM
Hi Ben,

It's the date I wish to change. At the moment it shows as 4/1/2009 but here in the UK we show it as 1/4/2009. Can this be done?

Thanks for the links too.
Apr 1, 2009 at 10:24 PM
I see.  There's two options.

My first recommendation would be to try and change the blog so it's using UK language/culture settings.  If you don't want to bother with this, you can skip to the next option (option 2).

In the App_GlobalResources folder in the blog, make a copy of the labels.resx file.  The new file should be called labels.en-gb.resx.  After doing this, if you go to the Settings tab in the control panel, in the "Choose language" dropdown box, you should have a choice for "English (United Kingdom)".  Select that and Save Settings.

At this point, the date in the comments may already be in Day/Month/Year format.  If it is, then you can skip option 2 below.  This is probably a better way to do it so other dates and settings on the blog will use UK settings.

Option 2.  In the CommentView.ascx file in your theme directory (themes\YourTheme), the date is outputted in there.  It will probably look something like:

<%= Comment.DateCreated %>

Changing that to the line below will force a Day/Month/Year format.

<%= Comment.DateCreated.ToString("d/M/yyyy") %>
Apr 1, 2009 at 10:40 PM
Hi Ben, 

I used the "labels.en-gb.resx" option and it worked great