Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Jan 29, 2015 at 07:34 PM by Landern for the following reason:

Other-Question is not specific enough: Please try yourself, this is a HUGE ask and not appropriate for UA. This is a design question and require significant back and forth, please consider use the forums.

avatar image
0
Question by KnightRiderGuy · Jan 29, 2015 at 07:11 PM · uitime.deltatimedeltatimeclock

Digital Clock Needed For New UI Text

I have been looking for a way to make a simple digital clock that uses the new UI text. It just needs to display the current time in Hours, minutes and seconds and have an Am or PM display as well something like:

05:43:21 AM

Bonus if it can be made to display the date as well like: Aug. 09 2015

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

  • Sort: 
avatar image
0

Answer by PorkMuncher · Jan 29, 2015 at 07:27 PM

System.DateTime.Now

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image KnightRiderGuy · Jan 29, 2015 at 07:54 PM 0
Share

I have this nice little script that I tweaked to suit my needs more but I want to see if I can add in an A$$anonymous$$ or P$$anonymous$$ display too?

 #pragma strict
  
 var ClockText  : GUIText;  // Hierarchy DRAG E DROP over var GUI Text in Inspector  
 var ClockDateText  : GUIText;  // Hierarchy DRAG E DROP over var GUI Text in Inspector
 var ClockSecondsText  : GUIText;  // Hierarchy DRAG E DROP over var GUI Text in Inspector
 private var dt = Date();
   
   
 function Update () {
   
 var day = dt.Now.Day;
 var month = dt.Now.$$anonymous$$onth;
 var year = dt.Now.Year;
 var hours = dt.Now.Hour;
 var $$anonymous$$utes = dt.Now.$$anonymous$$inute;
 var seconds = dt.Now.Second;
   
 ClockText.text = hours + ":" + $$anonymous$$utes;
 ClockDateText.text = day + " " + month + " " + year + " ";
 ClockSecondsText.text = seconds + " "; 
 }

Follow this Question

Answers Answers and Comments

19 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Why will this timer not count down? 1 Answer

Why does fixed Timestep affect deltatime in Update? 2 Answers

Time.deltatime is returning 0? 1 Answer

gameobject not setting active after timer ends 2 Answers

RotateTowards with deltaTime Causes Spinning! 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges