Add Custom DateTime Format to Blog Posts

by BizTron 11. September 2008 09:42

 

DateTime Format for Blog Posts for BlogEngine.NET

...or wherever you want to standardize output formatting.

Here is a rather simple solution to my issue of Date Time formatting on my blog posts.  I noticed that as of a recent version of BlogEngine.NET, the Date looked something like this: "29. June 2008 09:00"  I wanted to change it to something more readable to my target readers, some very local, such as: "Sunday, June 29, 2008 09:00 AM".  Well, I might want to change it sometime, AND I would like to drop it into multiple Themes, so I decided to place the format in Web.Config AppSettings. I looked up my specific Format and added an appSetting.  Then I just replaced the code used in "PostView.ascx" and tested away.

Here's what you can do to implement this yourself.

  1. Go to .NET Framework Developer's Guide, Custom Date and Time Format Strings and/or locate your format string.
    • I used "dddd, MMMM dd, yyyy hh:mm tt"
  2. Create an appSettings key such as: Custom.DateFormat and assign your format to the value.
    • <add key="Custom.DateFormat" value="dddd, MMMM dd, yyyy hh:mm tt" />
  3. Now add the code to use the format string.
    • <%=Post.DateCreated.ToString(ConfigurationSettings.AppSettings["Custom.DateFormat"])%>
    • original: <%=Post.DateCreated.ToString("d. MMMM yyyy HH:mm") %>

 More...

Tags: ,

.NET | ASP.NET | BlogEngine.NET | Web

Using the Entity Framework in .Net 3.5 SP1

by BizTron 3. September 2008 08:00

From: TVUG President, Griff Townsend:

Sorry for the delay in getting this out: things always seem to get hectic around the time to put announcements out, and this month was no exception. With that said, I've spoken with this month's presenter (in the mirror), and he is ready to go.
Using the Entity Framework in .Net 3.5 SP1


Speaker: Griffith Townsend, MCP.Net, MCSE
When: Tuesday September 8th, 2008 - 6:30-9PM
Where: VersaTrans Solutions, Latham, NY


When developing multi-tiered applications, it’s not uncommon that to encounter code and architectural “noise” where a developer is forced to shift languages between the business logic layer and the data layer. The preference of many developers is the use of tools (typically Object Relational Mapping solutions) to abstract the database-specific aspects of the data layer into objects usable by the upper layers by object-oriented programming languages. More...

Tags: , , ,

.NET | ADO.NET | Architecture | LINQ | SQL Server

Powered by BlogEngine.NET 1.6.0.1
Theme by Extensive SEO



Recent Posts


CompUSA

Elan Form Etch | Hard-shell Etched Leather Case

Handango Inc.

J&R Computer/Music World

Hot Offers

OmahaSteaks.com, Inc.

Tech Depot - An Office Depot Co.

TigerDirect

Toshiba - Toshibadirect.com