Question

What timezone are the usage graphs for a droplet?

When I log into the dashboard for drop lets, select a drop and view the graphs for bandwidth, cpu and disk. It doesn’t match my EST timezone.

Is there a way to change this so that the graphs are shown in EST?

Show comments

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

The developers could implement this frontend by jquery. Just let the user choose his timezone by a dropdown, and transfer the time stamps on the graphs.

Momentjs is great for converting timestamps.

The time stamps are put in tspan:

<tspan x="0" dy=".71em" dx="0">07:51 AM</tspan>

Jquery to get the AM/PM timestamps with the current DOM:

$('tspan:contains("AM"), tspan:contains("PM")').each( function(){ 
   console.log($(this).text()) 
});

And now we could use the magic of momentjs:

$.getScript( "https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.14.1/moment.min.js" );
$.getScript( "https://cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.5.5/moment-timezone.min.js" )
.done(function( script, textStatus ) {
   $('tspan:contains("AM"), tspan:contains("PM")').each( function(){ 
      var time_am_pm = $(this).text(); 
      var dt_hour = moment(time_am_pm, ["h:mm A"]).format("HH");
      var dt_min = moment(time_am_pm, ["h:mm A"]).format("mm");
      var now = moment();
      var date = now.set({ hour: parseInt(dt_hour, 10), minute: parseInt(dt_min , 10) }).toDate();
      // not working: 
         // var usertimezone = 'Europe/Berlin';
         // var newtime = moment(date).tz(usertimezone ).format('HH:mm');
      // hour offset - use what you need here!
      var newtime = moment(date).add(2, 'hours').format('HH:mm'); 
      $(this).text(newtime);
   });
});

Before: http://i.imgur.com/f0qjoZ0.png Afterwards: http://i.imgur.com/1CGND8X.png

Bookmarklet:

You can create a bookmarklet that does the job:

  1. Create a link.
  2. Edit the link and replace the URL with this one liner:
javascript:(function(e,a,g,h,f,c,b,d){if(!(f=e.jQuery)||g>f.fn.jquery||h(f)){c=a.createElement("script");c.type="text/javascript";c.src="https://code.jquery.com/jquery-latest.js";c.onload=c.onreadystatechange=function(){if(!b&&(!(d=this.readyState)||d=="loaded"||d=="complete")){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.childNodes[0].appendChild(c)}})(window,document,"1.3.2",function($,L){ $.getScript( "https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.14.1/moment.min.js" ); $.getScript( "https://cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.5.5/moment-timezone.min.js" ).done(function( script, textStatus ) { $('tspan:contains("AM"), tspan:contains("PM")').each( function(){ var time_am_pm = $(this).text(); var dt_hour = moment(time_am_pm, ["h:mm A"]).format("HH"); var dt_min = moment(time_am_pm, ["h:mm A"]).format("mm"); var now = moment(); var date = now.set({ hour: parseInt(dt_hour, 10), minute: parseInt(dt_min , 10) }).toDate(); var newtime = moment(date).add(2, 'hours').format('HH:mm');$(this).text(newtime); }); }); });

Click the link when you are on Digital Ocean’s graph site!

It looks like it defaults to GMT time. I would also like to modify my timezone to match the local time. I don’t know how to change it either.

This comment has been deleted

    Try DigitalOcean for free

    Click below to sign up and get $200 of credit to try our products over 60 days!

    Sign up

    Become a contributor for community

    Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

    DigitalOcean Documentation

    Full documentation for every DigitalOcean product.

    Resources for startups and SMBs

    The Wave has everything you need to know about building a business, from raising funding to marketing your product.

    Get our newsletter

    Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

    New accounts only. By submitting your email you agree to our Privacy Policy

    The developer cloud

    Scale up as you grow — whether you're running one virtual machine or ten thousand.

    Get started for free

    Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

    *This promotional offer applies to new accounts only.