Date Time Widget scripting question
Sunday, January 20, 2008 by HeirOfSlytherin | Discussion: OS Customization
Reply #2 Sunday, January 20, 2008 6:47 AM
- desktopx.Object("secondhand").rotation = second(now) * 6
- desktopx.Object("minutehand").rotation = minute(now) * 6
- desktopx.Object("hourhand").rotation = (hour(now) * 30) + (30 * minute(now)/60)
Reply #3 Sunday, January 20, 2008 1:39 PM
Reply #4 Sunday, January 20, 2008 1:47 PM
Object.SetTimer 1000, 30000
Call setinfo
End Sub
Sub Object_OnTimer1000
Call setinfo
End Sub
Sub setinfo
desktopx.Object("DayOfWeek").text=WeekDayName(Weekday(now),False)
desktopx.Object("MonthName").text=MonthName(Month(now)
desktopx.Object("Year").text=Year(now)
desktopx.Object("Date").text=Day(now)
t = FormatDateTime(time(),3)'---Get your system time
h= hour(t)'---Get current hour
desktopx.object("hour_hand").Rotation= h * 30 '---Multiply current hour to get correct rotation
m= minute(t)'---Get current minute
desktopx.object("minute_hand").Rotation= m * 6 '---Multiply current minute to get correct rotation
s= second(t)'---Get current second
desktopx.object("second_hand").Rotation= s * 6 '---Multiply current second to get correct rotation
End Sub
This is what i am trying to put together. Date-Time(analog)Widget.
Reply #5 Sunday, January 20, 2008 2:17 PM
Reply #6 Monday, January 21, 2008 4:34 AM
Sub Object_onscriptenter
object.SetTimer 1, 1000
End Sub
Sub object_ontimer1
t = FormatDateTime(time(),3)'---Get your system time
h= hour(t)'---Get current hour
desktopx.object("hour_hand").Rotation= h * 30 '---Multiply current hour to get correct rotation
m= minute(t)'---Get current minute
desktopx.object("minute_hand").Rotation= m * 6 '---Multiply current minute to get correct rotation
s= second(t)'---Get current second
desktopx.object("second_hand").Rotation= s * 6 '---Multiply current second to get correct rotation
desktopx.Object("DayOfWeek").text = WeekDayName(Weekday(now), False)
desktopx.Object("MonthName").text = MonthName(Month(now))
desktopx.Object("Year").text = Year(now)
desktopx.Object("Date").text = Day(now)
End Sub
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!







Reply #1 Sunday, January 20, 2008 6:13 AM
Basically you have to rotate the 'hands' bitmaps by working out the # of degrees per second/minute/hour. It's reasonably obvious once you see an example.
HTH