Display the time in the Global rackspace

Here is a trivial Global Rackspace intended only to show how the current time can be displayed on a label in the global rackspace using a simple script.

Download and save.

Then create a new gigfile, click on the Global Rackspace button and then go to File - Import Global Rackspace to load it

GR-ShowCurrentTime.rackspace (16.8 KB)

7 Likes

Absolutely perfect! Thank you so much!

2 Likes

Nice!

1 Like

This is totally SWEET. Thanks, David.

PS, do you think my global is getting a little cluttered….

I think you need the weather…..

2 Likes

I was thinking about augmenting it to show two timezones at once, since our band seems to dance between EST and CST regularly! :smiley:

1 Like

3 Likes

Is it possible I can download this into my current Global Rackspace? I am not sure how to do it.

What does “this” refer to?

I think he wants to knows if he needs to bring an umbrella :smiling_face_with_sunglasses:

Actually - the next update to GP will have this as a built-in. For now, the way to do it is this

  1. Drag a text widget into a rackspace (or the global rackspace)
  2. Select the widget in edit mode, click on Advanced and set the GPScript handle to lblShowTime
  3. In the Windows menu, open the “Current Rackspace Script Editor” or “Global Rackspace Script editor” depending on to where you dragged your text widget and copy the code below into it.
//$<AutoDeclare>
// DO NOT EDIT THIS SECTION MANUALLY
Var
   lblShowTime : Widget
//$</AutoDeclare>


// CODE FOR CLOCK
// ========================================

On TimerTick(ns : double)
var str_format : string = "%I:%M:%S %p"

   SetWidgetLabel(lblShowTime,    FormatTime(ClockTime(),str_format))

End

Initialization
    SetTimersRunning(true)
End
  1. Press the compile button and it should work

1 Like

Very basic scripting skills here… If I already have this in my script:

On TimerTick(ms : double)
if ms - LAST_TIME > PRESET_ACTIVATE_DELAY then
if PRESET3 <> LAST_PRESET3 then
LoadGPPreset(SANDMAN, PRESET3)
end
LAST_PRESET3 = PRESET3
SetTimersRunning(false)
end
End

Can I add your

On TimerTick(ms : double) 
var str_format : string = "%I:%M:%S %p"

SetWidgetLabel(lblShowTime,    FormatTime(ClockTime(),str_format))

End

under my existing On TimerTick and if so, what about the conflicting SetTimersRunning(false) (in my script) vs the SetTimersRunning(true) here? How do I handle that? Thanks!

No, there’s only one timer tick callback - you’d have to leave it running all the time and use a boolean flag or some kind of counter to manage the two completely separate activities

1 Like

Thank you!!

You may have understood it correctly, but just to make sure, when I said “under my existing On TimerTick” I meant WITHIN my existing On TimerTick (not to create another). But of course they’re it’s still the issue of true vs false for the SetTimersRunnin.