473,419 Members | 1,925 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,419 software developers and data experts.

How to format date like Day, Month date, Year time

this one should be pretty simple. All I want to do is formatdate in this format.

Saturday, September 25, 2010 12:00 am

Expand|Select|Wrap|Line Numbers
  1.  
  2. function getRecordInfo(oLink, iIndex) {
  3.  
  4.                 var Subject = GridBulletins.Rows[iIndex].Cells[0].Value;
  5.                 var Bulletin = GridBulletins.Rows[iIndex].Cells[1].Value;
  6.                 var DateStamp = GridBulletins.Rows[iIndex].Cells[2].Value;
  7.  
  8.  
  9.  
  10.  var sNewHtml = "<div style='text-align: left; padding: 3px;'>";
  11.                  sNewHtml += "<b>Subject</b> " + Subject + "<br><br>";
  12.                  sNewHtml += "<b>Bulletin</b> " + Bulletin + "<br><br>";
  13.                  sNewHtml += "<b>Date</b> " + DateStamp + "";
  14.  
  15.                  return sNewHtml;
  16.             }
  17.  
  18.  
Oct 22 '10 #1
3 2872
gits
5,390 Expert Mod 4TB
how does DateStamp look like at the moment?
Oct 22 '10 #2
like this

Date: 10/19/2010 1:49:47 PM
Oct 22 '10 #3
gits
5,390 Expert Mod 4TB
you might create a javascript Date object from that like:

Expand|Select|Wrap|Line Numbers
  1. var jsDate = new Date('10/19/2010 1:49:47 PM');
and then use the Date's methods to create the desired output. You could even use RegExp or String-Methods to parse your date-string and modify it ...

if you really want to display full day/month-names then you will probably have to create some mappings where 'Tue' maps to 'tuesday' or 'Oct' to 'October' or similar mappings - depending on the method you would choose to process the data.
Oct 23 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: praba kar | last post by:
Dear All, In Php we can print RFC 2822 formatted date by date('r') with parameter r. Then it will print the below format date. "Thu, 7 Apr 2005 01:46:36 -0300". I want to print same RFC 2822...
2
by: amith | last post by:
hi I have written javascript for comparing two dates in US format and finding out whether the start date is greater than the end date and vice versa. In this attempt i have instantiated the...
4
by: peashoe | last post by:
I have an asp page that uses a calendar.js (pop-up) file to add an exact date format in the text field (txtDDate). My problem is I need some javascript that sets an alert that does not allow them...
0
by: lsy | last post by:
i wonder how can i order my statement interm of "ORDER BY FORMAT(Date, 'mmmm')" with using this it will order by alphabethical but i want it order by month... i had try "ORDER BY FORMAT(Date, 'mm')"...
1
by: Keith Chadwick | last post by:
Been trying to use the ms:format-date() in one of my transformations. I have all of the necessary declarations in my xml as in <?xml version="1.0" ?> <data xml:space="default"...
1
by: '[] WiRaN | last post by:
one know format date in c#???? or validate?
1
by: G Gerard | last post by:
Hello I am having some problem comparing dates with the SQL statement below MySQL = "SELECT Format(Date, 'yyyy/mmmm/dd') as FROM TblDates WHERE _ Format(Date, 'yyyy/mmmm/dd') =...
2
by: fniles | last post by:
How do you do Format(Date, "mmddyy") in VB.NET ? Thank you
8
by: libsfan01 | last post by:
how can i use regular expressions to ensure a mysql format date entry in a text field? thanks marc
5
mgpsivan
by: mgpsivan | last post by:
Hi, i have form in Asp.net(2003) in that i've to change the format of the date by the following statement Format(Date.Today, "dd/mm/yyyy") but when i give this code the month part displays as...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.