Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently January 10th, 2025, 2:31 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Time/Date Stamp
PostPosted: November 8th, 2006, 3:42 pm 
Offline

Joined: January 6th, 2005, 8:56 pm
Posts: 330
Location: Houston, Republic of Texas
Opus: 8
OS: W7 Pro
System: Dell Precision T5500, 8 core Dual Xeon 2.13 GHz, 24 GB RAM, All SSD drives
Another "easy" one. How do I place a time/date stamp in a text box? Of c ourse, I can use the systime variables, but these update. I just need the current date/time inserted as text.

Also, is possible to set the systime variables to display the more common XX:XX:XX (where the leading X is a 0 when less than 10) as opposed to the 9:10:1 display it uses? It would look much better when displayed as a functioning clock as I use it on our classroom screens.

Dave

_________________
An objective is a description of a performance you want your learners to be able to exhibit before you consider them competent.
Dr. Robert F. Mager, 1962

"If you can't measure it, it's crap."
David A. Mallette, 1980


Top
 Profile  
 
 Post subject: Date Time
PostPosted: November 8th, 2006, 5:44 pm 
Offline

Joined: October 25th, 2004, 2:20 pm
Posts: 686
Location: Naperville, Illinois (USA)
Opus: 7.05
OS: Win XP SP3
System: P4 3.2GHz 1GB RAM 2-TB HDs + 4 more
Dave --

First, create new text Variables for your custom time functions. I use things like HH and MM and SS for hours, minutes, and seconds.

Next you need to create a Trigger which will read SYSTEM_TIME_HOUR and evaluate it with some programming logic to determine if the number is greater than 12, for example. If it is, then subtract 12 and set the remainder equal to HH. You'll need to check if the number is less than 10 so you can insert a "0" to make it a two digit number. Create similar logic for minutes (SYSTEM_TIME-MINUTE), and seconds (SYSTEM_TIME_SECOND). In those cases, you'll only check to see if the value is less than 10.

Finally, create a Text Object and insert each of your text Variables with a colon in between (example: Here is the current time: <HH>:<MM>:<SS>)

Once you've created this code/logic you can re-use it everytime you need the time displayed.

_________________
Fred Harms, Extraordinary Demos
Naperville, Illinois (USA) 630/904-3636
demofred@aol.com


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 8th, 2006, 6:06 pm 
Offline

Joined: November 3rd, 2004, 2:11 pm
Posts: 323
You could also do the following. Create an onshow trigger and then attach a scripting action to it. In the script put the following:

Code:
var myDate = new Date();
var curhours=myDate.getHours();
var curmins=myDate.getMinutes();
var cursecs=myDate.getSeconds();


if (curhours<10)
{
curhours="0"+curhours;
}

if (curmins<10)
{
curmins="0"+curmins;
}

if (cursecs<10)
{
cursecs="0"+cursecs;
}

current_date=SYSTEM_TIME_MONTH+" "+SYSTEM_TIME_DATE+", "+SYSTEM_TIME_YEAR;
current_time=curhours+":"+curmins+":"+cursecs;
currentfulldate=current_date+" "+current_time;


Make sure you create a publication variable called 'currentfulldate' and then you can pop this timestamp in your text boxes where you wish.

_________________
Opus Pro XE 9.1 Win7 64-bit Core i3 8MB RAM


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 8th, 2006, 6:39 pm 
Offline

Joined: January 6th, 2005, 8:56 pm
Posts: 330
Location: Houston, Republic of Texas
Opus: 8
OS: W7 Pro
System: Dell Precision T5500, 8 core Dual Xeon 2.13 GHz, 24 GB RAM, All SSD drives
Yikes. Not really easy as I assumed. Thanks for the responses. I'll evaluate and see if I can get them to work...

Regards,
Dave

_________________
An objective is a description of a performance you want your learners to be able to exhibit before you consider them competent.
Dr. Robert F. Mager, 1962

"If you can't measure it, it's crap."
David A. Mallette, 1980


Top
 Profile  
 
 Post subject:
PostPosted: November 8th, 2006, 6:51 pm 
Offline

Joined: November 3rd, 2004, 2:11 pm
Posts: 323
It may look difficult, but I'm sure Fred's way is easy and it took me all of the time to type the code to do what I think you were asking to do.

I suppose, it depends on your definition of what easy is :wink:

_________________
Opus Pro XE 9.1 Win7 64-bit Core i3 8MB RAM


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 8th, 2006, 8:16 pm 
Offline

Joined: January 6th, 2005, 8:56 pm
Posts: 330
Location: Houston, Republic of Texas
Opus: 8
OS: W7 Pro
System: Dell Precision T5500, 8 core Dual Xeon 2.13 GHz, 24 GB RAM, All SSD drives
Yep, between the two of you got just what I needed. You guys are great and I hope the DW team realizes what a value-added this board is. I hope I am able to return some value at some point.

Thanks and kudos.

Dave

_________________
An objective is a description of a performance you want your learners to be able to exhibit before you consider them competent.
Dr. Robert F. Mager, 1962

"If you can't measure it, it's crap."
David A. Mallette, 1980


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 71 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group