• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 458
  • Last Modified:

toUTCString -- parse the parts of the date

I was trying to convert my date to GMT and then get each individual date part but it won't let me use the normal getMonth, getDate, etc--I'm guessing because it converted the date to a string?   How can I get the individual parts of the date like my code below the following 2 lines?   The date has to be in GMT.

dteDate = new Date();
dteDate = dteDate.toUTCString();


// this is how i originally broke the date apart before converting to GMT      
var dteMonth = dteDate.getMonth() + 1;
var dteDay = dteDate.getDate();
var dteYear = dteDate.getYear();
var dteHours = dteDate.getHours();
var dteMin = dteDate.getMinutes();
var dteSec = dteDate.getSeconds();
0
saturation
Asked:
saturation
  • 3
1 Solution
 
leakim971PluritechnicianCommented:
0
 
leakim971PluritechnicianCommented:
dteDate = new Date();
dteDate = formatDate(d);

Open in new window

0
 
leakim971PluritechnicianCommented:
oups
dteDate = new Date();
dteDate = formatDate(dteDate);

Open in new window

0
 
saturationAuthor Commented:
Perfect!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now