For shiggles, I wanted to add a nice little trendy date format to my postings, but everything I found seemed a bit too wordy for me. It always looks like this:
<div class="post-date"> <span class="month">10</span> <span class="day">04</span> <span class="year">1977</span> </div>
This site is dynamically generated, so it wouldn't take too much effort in order to implement such a structure, but I'm stubborn... so here goes
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Imaging" %>
<script language="VB" runat="server">
Sub Page_Load(sender as Object, e as EventArgs)
dim strDt as string = request.querystring("dt")
dim strMonth as string = left(MonthName(Month(strDt)),3).ToUpper()
dim strDay as string = Day(strDt).ToString()
if strDay.Length=1
strDay="0" & strDay
end if
dim strYear as string = Year(strDt).ToString()
Dim baseMap as Bitmap = new Bitmap(95, 13)
'13 cuts it off, which looks cool -- see emersian.com
Dim myGraphic as Graphics = Graphics.FromImage(baseMap)
Dim upBrush as SolidBrush = new SolidBrush(Color.black)
Dim downBrush as SolidBrush = new SolidBrush(Color.steelblue)
Dim MonthFont as Font = new Font("tahoma", 11,FontStyle.Bold)
Dim dtFont as Font = new Font("tahoma", 14,FontStyle.Bold)
myGraphic.FillRectangle(new SolidBrush(Color.white), 0, 0, 100, 25)
myGraphic.DrawString(strMonth, MonthFont, upBrush, 0, 0)
myGraphic.DrawString(strDay, MonthFont, downBrush, 30, 0)
myGraphic.DrawString(strYear, MonthFont, upBrush, 50, 0)
myGraphic.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias
Response.ContentType = "image/gif"
baseMap.Save(Response.OutputStream, ImageFormat.GIF)
myGraphic.Dispose()
baseMap.Dispose()
End Sub
</script>
%>
< img src="dt.aspx?dt=DATE STRING HERE" />
7/8/2008 2:16:49 PM Very Good Site <a href=" teen pic ">preteen tgp</a> zyaslv <a href=" teen cartoons ">teenage suicides</a> 8-]]]