»
 

Go Back   ResellerRatings Store Ratings > ResellerRatings Forums > Tech Support

Reply
 
LinkBack Thread Tools Display Modes
Old 06-05-2003, 04:22 PM   #1 (permalink)
Registered User
 
Join Date: Oct 2001
Location: TOO close to Wash DC
Posts: 7,956
vass0922 is on a distinguished road
JScript DateTime Numeric format

OK this can NOT be that difficult but trying to find anything on google on JScript thats not .NET related is getting tougher

Ok ALL I need is the datetime in numeric format.. it has to be the date and the time because I'm using this as a unique id and this will be faster than using a unique id called from a database.

Mind this will be called from a webpage so make sure that is possible...

For instance...

<SCRIPT LANGUAGE="JavaScript" FOR=chkPartReqd EVENT=onclick>
window.parent.frames(0).document.theFCO.ControlVal ueChanged(document.forms[0].chkPartReqd);
window.parent.frames(0).document.theFCO.setVarForm ula("GlobalID", DateTime.Now());
</SCRIPT>

What goes into that bold area?!

vass0922 is offline   Reply With Quote
Old 06-05-2003, 05:02 PM   #2 (permalink)
Registered User
 
Join Date: Oct 2001
Location: Alberta, Canada
Posts: 546
^hyd^ is on a distinguished road
depends what format you need it in?
mm/dd/yy hh:mm:ss is ignorant because afaik, there's now default method for creating this format, you'd have to create a date object(var dt = new Date(); etc) and conactenate everything together, ...pain in the ___!!
or, you could just use plain ol' Date(), it'll return a format of: "Thu Jun 5 16:58:24 MDT 2003" which just might suffice...

here's a couple links that may or may not help!
couple good functions
whole buncha date stuff!!
some stuff from MS...

oh, and does it have to be JScript?? 'cause all them examples are javascript!!

Cheers!
^hyd^
^hyd^ is offline   Reply With Quote
Old 06-05-2003, 05:13 PM   #3 (permalink)
Registered User
 
Join Date: Oct 2001
Location: TOO close to Wash DC
Posts: 7,956
vass0922 is on a distinguished road
Ahhhhh
dateObj.getTime() Does get what I believe is what I need
GMT milliseconds (+ or -) since zero hours GMT, January 1, 1970
1054901352000

Fabulous!! I'll give it a shot, thanks for the help!!

Oh and how would I say in this stuff If value <> = Then getthisvalue...

man I feel like such a newbie lol
something like...
Code:
var vGlobalId = 0
window.parent.frames(0).document.theFCO.ControlValueChanged(document.forms[0].chkPartReqd);
vGlobalId = window.parent.frames(0).document.theFCO.getVarFormula("GlobalID");
If vGlobalID != 0 Then
  window.parent.frames(0).document.theFCO.getVarFormula("GlobalID", datObj.GetTime())
End IF
Hmm need stupid curly braces I think
__________________
<< Insert exceedingly large and overly verbose message of how 1337 you are here including full specs of every vehicle you've ever driven and PC you've owned >>
vass0922 is offline   Reply With Quote
Old 06-05-2003, 05:51 PM   #4 (permalink)
Registered User
 
Join Date: Oct 2001
Location: Alberta, Canada
Posts: 546
^hyd^ is on a distinguished road
jscript and javascript are like c++/java

Code:
If vGlobalID != 0 Then
  window.parent.frames(0).document.theFCO.getVarFormula("GlobalID", datObj.GetTime())
End IF
should be
Code:
if ( vGlobalID != 0 ){
  window.parent.frames(0).document.theFCO.getVarFormula("GlobalID", datObj.GetTime())
}
ciao!
^hyd^ is offline   Reply With Quote
Old 06-05-2003, 06:14 PM   #5 (permalink)
Registered User
 
Join Date: Oct 2001
Location: TOO close to Wash DC
Posts: 7,956
vass0922 is on a distinguished road
great!
Thanks
__________________
<< Insert exceedingly large and overly verbose message of how 1337 you are here including full specs of every vehicle you've ever driven and PC you've owned >>
vass0922 is offline   Reply With Quote
Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Most Active Discussions

Recent Discussions

All times are GMT -6. The time now is 04:06 AM.