vMix Forums
	 » 
	General
	 » 
	General Discussion
	 » 
	Timezone World clock that flips
	 
	
        
            
            
    
        
	Rank: Member
  Groups: Registered
 Joined: 4/6/2020(UTC) Posts: 20   Location: Melbourne Thanks: 1 times
  
	 
	
     | 
    
        
            
		      
                Hey all, trying to add a world clock to our ticker bar down the bottom, which flips between say 10 different city times every 10 seconds.
  Any one been able to do this? I've done a fair bit of researching but really struggling. I've looked into APIs for world clocks etc but it just ends in a habit hole of google ads and nothing to show for it.
  Cheers. 
            
	  
         
     | 
    | 
         
             
     | 
    
         
            
         
     | 
    | 
        
	
     | 
        
        
        
            
        
            
            
    
        
	Rank: Advanced Member
  Groups: Registered
 Joined: 12/27/2012(UTC) Posts: 5,453  Location: Belgium Thanks: 311 times Was thanked: 1008 time(s) in 830 post(s)
  
	 
	
     | 
    
        
            
		      
                Originally Posted by: ticker  Hey all, trying to add a world clock to our ticker bar down the bottom, which flips between say 10 different city times every 10 seconds.
  Any one been able to do this? I've done a fair bit of researching but really struggling. I've looked into APIs for world clocks etc but it just ends in a habit hole of google ads and nothing to show for it.
  Cheers.  using scripting will be your best bet to update the ticker content using a correct time format for  the timing and  zone selection (maybe even datasource)  Sure you want this in a ticker or is it an addition outside the ticker ? see: https://forums.vmix.com/...ng-for-Dummies#post89490 
            
	  
         
     | 
    | 
         
             
     | 
    
         
            
         
     | 
    | 
        
	
     | 
        
        
        
    
        
            
            
    
        
	Rank: Advanced Member
  Groups: Registered
 Joined: 12/27/2012(UTC) Posts: 5,453  Location: Belgium Thanks: 311 times Was thanked: 1008 time(s) in 830 post(s)
  
	 
	
     | 
    
        
            
		      
                  timezones.png  (201kb) downloaded 29 time(s).  timezonetitle.png  (78kb) downloaded 10 time(s).Code:'Title has Location.Text
'Title has timedif.Text to hold the timezone adjustment (will need to be hidden)
'Title has Zonetime.Text that will receive the current location time
' A data source  with Location in one column and timeadjust in the other 
' link data source appropriatly (Location.Text  &  timedif.Text 
' let the datasource auto loop with desired delay
' run the script
dim zone as integer = 0
dim oldlocation as string = ""
dim location as string = ""
dim zonetime as DateTime 
do while true
   location = Input.Find("timezone.gtzip").Text("Location.Text") 
 if location <> oldlocation 
   zone = CInt(Input.Find("timezone.gtzip").Text("timedif.Text")) 
   zonetime = DateTime.Now.AddHours(zone)
   Input.Find("timezone.gtzip").Text("Zonetime.Text")= zonetime.ToString("H:mm")
   oldlocation = location
 end if 
sleep(250)
loop
 
  
            
	  
         
     | 
    | 
         
             
     | 
    
         
            
         
     | 
    | 
        
	
     | 
        
        
        
            
        
            
            
    
        
	Rank: Newbie
  Groups: Registered
 Joined: 11/16/2021(UTC) Posts: 2  Location: Melbourne Thanks: 1 times
  
	 
	
     | 
    
        
            
		      
                thanks for this script,  I used it on a show recently and it worked magnificatly,  however one thing that I noticed is that we had a couple of timezones that are 1/2 hour differences for example Darwin is 1.5 hours behind Melbourne.  when I pluged 1.5 into the spreadsheet  it imported fine into the data manager as 1.5 but when the script ran it rounded the value up to 2! so Darwin was 2 hours behind rather then the 1.5 hours,  is there something in the script that I missed?
  thanks again for the help 
            
	  
         
     | 
    | 
         
             
     | 
    
         
            
         
     | 
    | 
        
	
     | 
        
        
        
    
        
            
            
    
        
	Rank: Advanced Member
  Groups: Registered
 Joined: 12/27/2012(UTC) Posts: 5,453  Location: Belgium Thanks: 311 times Was thanked: 1008 time(s) in 830 post(s)
  
	 
	
     | 
    
        
            
		      
                Originally Posted by: leithgolding  thanks for this script,  I used it on a show recently and it worked magnificatly,  however one thing that I noticed is that we had a couple of timezones that are 1/2 hour differences for example Darwin is 1.5 hours behind Melbourne.  when I pluged 1.5 into the spreadsheet  it imported fine into the data manager as 1.5 but when the script ran it rounded the value up to 2! so Darwin was 2 hours behind rather then the 1.5 hours,  is there something in the script that I missed?
  thanks again for the help  Can't they do like  most of the world ;-) change:  Integer to Double  CInt to CDbl Helpful info : Google-> What is Difference Between "int" and "double"  
            
	  
         
     | 
    
        
              1 user thanked doggy for this useful post.  
     | 
    
        
     | 
    | 
        
	
     | 
        
        
        
            
        
            
            
    
        
	Rank: Newbie
  Groups: Registered
 Joined: 11/16/2021(UTC) Posts: 2  Location: Melbourne Thanks: 1 times
  
	 
	
     | 
    
        
            
		      
                Thanks for the code!   
  we like to be a little different here!
 
  
            
	  
         
     | 
    | 
         
             
     | 
    
         
            
         
     | 
    | 
        
	
     | 
        
        
        
    
        
            
            
    
        
	Rank: Newbie
  Groups: Registered
 Joined: 8/27/2024(UTC) Posts: 7   
	 
	
     | 
    
        
            
		      
                Originally Posted by: doggy    timezones.png  (201kb) downloaded 29 time(s).  timezonetitle.png  (78kb) downloaded 10 time(s).Code:'Title has Location.Text
'Title has timedif.Text to hold the timezone adjustment (will need to be hidden)
'Title has Zonetime.Text that will receive the current location time
' A data source  with Location in one column and timeadjust in the other 
' link data source appropriatly (Location.Text  &  timedif.Text 
' let the datasource auto loop with desired delay
' run the script
dim zone as integer = 0
dim oldlocation as string = ""
dim location as string = ""
dim zonetime as DateTime 
do while true
   location = Input.Find("timezone.gtzip").Text("Location.Text") 
 if location <> oldlocation 
   zone = CInt(Input.Find("timezone.gtzip").Text("timedif.Text")) 
   zonetime = DateTime.Now.AddHours(zone)
   Input.Find("timezone.gtzip").Text("Zonetime.Text")= zonetime.ToString("H:mm")
   oldlocation = location
 end if 
sleep(250)
loop
 
  the script is stopping due to error line 19 conversion from string "" to type 'Integer' is not valid please assit me in correcting it to be able to use this wonderful script  
            
	  
         
     | 
    | 
         
             
     | 
    
         
            
         
     | 
    | 
        
	
     | 
        
        
        
            
        
            
            
    
        
	Rank: Advanced Member
  Groups: Registered
 Joined: 12/27/2012(UTC) Posts: 5,453  Location: Belgium Thanks: 311 times Was thanked: 1008 time(s) in 830 post(s)
  
	 
	
     | 
    
        
            
		      
                Originally Posted by: MazajMusic  
  the script is stopping due to error line 19 conversion from string "" to type 'Integer' is not valid please assit me in correcting it to be able to use this wonderful script
  The script work totally fine (if there is a proper value in the title's timedif text field !, see comments at beginning of the script)  
            
	  
         
     | 
    | 
         
             
     | 
    
         
            
         
     | 
    | 
        
	
     | 
        
        
        
    
        
            
            
    
        
	Rank: Newbie
  Groups: Registered
 Joined: 8/27/2024(UTC) Posts: 7   
	 
	
     | 
    
        
            
		      
                Originally Posted by: doggy  Originally Posted by: MazajMusic  
  the script is stopping due to error line 19 conversion from string "" to type 'Integer' is not valid please assit me in correcting it to be able to use this wonderful script
  The script work totally fine (if there is a proper value in the title's timedif text field !, see comments at beginning of the script)  thank you for your reply but I am not seeing what is the issue and why I am getting this error if it is working fine what did i do wrong? any suggestions?  
            
	  
         
     | 
    | 
         
             
     | 
    
         
            
         
     | 
    | 
        
	
     | 
        
        
        
            
        
            
            
    
        
	Rank: Advanced Member
  Groups: Registered
 Joined: 12/27/2012(UTC) Posts: 5,453  Location: Belgium Thanks: 311 times Was thanked: 1008 time(s) in 830 post(s)
  
	 
	
     | 
    
        
            
		      
                Originally Posted by: MazajMusic  Originally Posted by: doggy  Originally Posted by: MazajMusic  
  the script is stopping due to error line 19 conversion from string "" to type 'Integer' is not valid please assit me in correcting it to be able to use this wonderful script
  The script work totally fine (if there is a proper value in the title's timedif text field !, see comments at beginning of the script)  thank you for your reply but I am not seeing what is the issue and why I am getting this error if it is working fine what did i do wrong? any suggestions?  The "timedif" text field in the used title needs to have a value , can not be empty and must be a integer number  The error indicates that this text field in your title is empty or doesnt have a integer value within  With the script it gets populated by the datasource (as per structure example) , see vMix video tutorials on how to create titles and put data into them to display, using datasources and use them to populate titles etc Question is are you using a properly structured title and datasource each filled with proper content? Car will run just fine with the proper fuel in it  
            
	  
         
     | 
    | 
         
             
     | 
    
         
            
         
     | 
    | 
        
	
     | 
        
        
        
    
        
            
            
    
        
	Rank: Newbie
  Groups: Registered
 Joined: 8/27/2024(UTC) Posts: 7   
	 
	
     | 
    
        
            
		      
                Originally Posted by: doggy  Originally Posted by: MazajMusic  Originally Posted by: doggy  Originally Posted by: MazajMusic  
  the script is stopping due to error line 19 conversion from string "" to type 'Integer' is not valid please assit me in correcting it to be able to use this wonderful script
  The script work totally fine (if there is a proper value in the title's timedif text field !, see comments at beginning of the script)  thank you for your reply but I am not seeing what is the issue and why I am getting this error if it is working fine what did i do wrong? any suggestions?  The "timedif" text field in the used title needs to have a value , can not be empty and must be a integer number  The error indicates that this text field in your title is empty or doesnt have a integer value within  With the script it gets populated by the datasource (as per structure example) , see vMix video tutorials on how to create titles and put data into them to display, using datasources and use them to populate titles etc Question is are you using a properly structured title and datasource each filled with proper content? Car will run just fine with the proper fuel in it  thank you so much for your help it worked just fine but the only issue i am facing now that the script stops after few hours and I have to click start again is there anything i can do to make it run without stopping and the need to restart it?  
            
	  
         
     | 
    | 
         
             
     | 
    
         
            
         
     | 
    | 
        
	
     | 
        
        
        
            
        
            
            
    
        
	Rank: Advanced Member
  Groups: Registered
 Joined: 12/27/2012(UTC) Posts: 5,453  Location: Belgium Thanks: 311 times Was thanked: 1008 time(s) in 830 post(s)
  
	 
	
     | 
    
        
            
		      
                Originally Posted by: MazajMusic  
  thank you so much for your help it worked just fine but the only issue i am facing now that the script stops after few hours and I have to click start again is there anything i can do to make it run without stopping and the need to restart it?
  Hard to know the casue if ther is no erro mentioned. Maybe the frequency of checkig within the script might be a casue (to quick)  
            
	  
         
     | 
    | 
         
             
     | 
    
         
            
         
     | 
    | 
        
	
     | 
        
        
        
    
        
            
            
    
        
	Rank: Newbie
  Groups: Registered
 Joined: 8/27/2024(UTC) Posts: 7   
	 
	
     | 
    
        
            
		      
                Originally Posted by: doggy  Originally Posted by: MazajMusic  
  thank you so much for your help it worked just fine but the only issue i am facing now that the script stops after few hours and I have to click start again is there anything i can do to make it run without stopping and the need to restart it?
  Hard to know the casue if ther is no erro mentioned. Maybe the frequency of checkig within the script might be a casue (to quick)  yes this is hard especially it is working just fine so i am wondering why it is stopped very few hours so i have to go to scripting section in vmix and click start i didn't change anything in the script i am using it as it  
            
	  
         
     | 
    | 
         
             
     | 
    
         
            
         
     | 
    | 
        
	
     | 
        
        
        
            
        
            
            
    
        
	Rank: Newbie
  Groups: Registered
 Joined: 8/27/2024(UTC) Posts: 7   
	 
	
     | 
    
        
            
		      
                Originally Posted by: doggy  Originally Posted by: MazajMusic  
  thank you so much for your help it worked just fine but the only issue i am facing now that the script stops after few hours and I have to click start again is there anything i can do to make it run without stopping and the need to restart it?
  Hard to know the casue if ther is no erro mentioned. Maybe the frequency of checkig within the script might be a casue (to quick)  hello again i found it when we reload the title the script stops and needs to be started again so i decided to tell it to you in case anyone face this issue same as me so whenever we reload the title we have to start again the script   
            
	  
         
     | 
    | 
         
             
     | 
    
         
            
         
     | 
    | 
        
	
     | 
        
        
        
    
        
            
            
    
        
	Rank: Advanced Member
  Groups: Registered
 Joined: 12/27/2012(UTC) Posts: 5,453  Location: Belgium Thanks: 311 times Was thanked: 1008 time(s) in 830 post(s)
  
	 
	
     | 
    
        
            
		      
                Originally Posted by: MazajMusic  Originally Posted by: doggy  Originally Posted by: MazajMusic  
  thank you so much for your help it worked just fine but the only issue i am facing now that the script stops after few hours and I have to click start again is there anything i can do to make it run without stopping and the need to restart it?
  Hard to know the casue if ther is no erro mentioned. Maybe the frequency of checkig within the script might be a casue (to quick)  hello again i found it when we reload the title the script stops and needs to be started again so i decided to tell it to you in case anyone face this issue same as me so whenever we reload the title we have to start again the script   That's normal as during the reload the script goes iinto error as it cant reference that input at that moment anymore What's the reason to reload the title in the first place ? if you really have to have a shortcut ready to start this script then   
            
	  
         
     | 
    | 
         
             
     | 
    
         
            
         
     | 
    | 
        
	
     | 
        
        
        
            
        
            
            
    
        
	Rank: Newbie
  Groups: Registered
 Joined: 8/27/2024(UTC) Posts: 7   
	 
	
     | 
    
        
            
		      
                Originally Posted by: doggy  Originally Posted by: MazajMusic  Originally Posted by: doggy  Originally Posted by: MazajMusic  
  thank you so much for your help it worked just fine but the only issue i am facing now that the script stops after few hours and I have to click start again is there anything i can do to make it run without stopping and the need to restart it?
  Hard to know the casue if ther is no erro mentioned. Maybe the frequency of checkig within the script might be a casue (to quick)  hello again i found it when we reload the title the script stops and needs to be started again so i decided to tell it to you in case anyone face this issue same as me so whenever we reload the title we have to start again the script   That's normal as during the reload the script goes iinto error as it cant reference that input at that moment anymore What's the reason to reload the title in the first place ? if you really have to have a shortcut ready to start this script then   i am using it with a news ticker so when we update the news we need to reload  
            
	  
         
     | 
    | 
         
             
     | 
    
         
            
         
     | 
    | 
        
	
     | 
        
        
        
    
        
            
            
    
        
	Rank: Advanced Member
  Groups: Registered
 Joined: 12/27/2012(UTC) Posts: 5,453  Location: Belgium Thanks: 311 times Was thanked: 1008 time(s) in 830 post(s)
  
	 
	
     | 
    
        
            
		      
                Originally Posted by: MazajMusic  Originally Posted by: doggy   That's normal as during the reload the script goes iinto error as it cant reference that input at that moment anymore
  What's the reason to reload the title in the first place ?
  if you really have to have a shortcut ready to start this script then 
  i am using it with a news ticker so when we update the news we need to reload  No you dont, just  change the text that needs to go into the ticker (manually, preset or datasource) Please do a search on how to change title content (including tickers) . There are plenty of videos about that to be found, especially from vMix itself  
            
	  
         
     | 
    | 
         
             
     | 
    
         
            
         
     | 
    | 
        
	
     | 
        
        
        
            
        
            
            
    
        
	Rank: Newbie
  Groups: Registered
 Joined: 8/27/2024(UTC) Posts: 7   
	 
	
     | 
    
        
            
		      
                Originally Posted by: doggy  Originally Posted by: MazajMusic  Originally Posted by: doggy   That's normal as during the reload the script goes iinto error as it cant reference that input at that moment anymore
  What's the reason to reload the title in the first place ?
  if you really have to have a shortcut ready to start this script then 
  i am using it with a news ticker so when we update the news we need to reload  No you dont, just  change the text that needs to go into the ticker (manually, preset or datasource) Please do a search on how to change title content (including tickers) . There are plenty of videos about that to be found, especially from vMix itself  yes i do that but it doesn't update unless I reload i do not touch the ticker itself i update news in a csv file and save it but the ticker doesn't update the new news in the file unless it is reloaded so i guess i have to search about it to see why it is not updating from the csv without reload thx anyway  
            
	  
         
     | 
    | 
         
             
     | 
    
         
            
         
     | 
    | 
        
	
     | 
        
        
        
    
                           
	vMix Forums
	 » 
	General
	 » 
	General Discussion
	 » 
	Timezone World clock that flips
	 
	
    
        Forum Jump
         
	
    
    You cannot post new topics in this forum.
	
	You cannot reply to topics in this forum.
	
	You cannot delete your posts in this forum.
	
	You cannot edit your posts in this forum.
	
	You cannot create polls in this forum.
	
	You cannot vote in polls in this forum.
	
	
    
    
        Important Information:
        The vMix Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
        
        
More Details
        Close