Cody

Problem 45848. What is the current time in Darwin, Australia?

Solution 2742340

Submitted on 26 Jul 2020 by Binbin Qi
  • Size: 22
  • This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
tz = 'Australia/Darwin'; td = [2020 6 9 21 50 0]; y_correct = 'Jun-10-2020 07:20'; assert(isequal(world_time(td,tz),y_correct))

2   Pass
tz = 'America/St_Johns'; td = [2000 1 1 10 05 0]; y_correct = 'Jan-01-2000 06:35'; assert(isequal(world_time(td,tz),y_correct))

3   Pass
tz = 'Asia/Calcutta'; td = [1999 9 9 9 9 9]; y_correct = 'Sep-09-1999 14:39'; assert(isequal(world_time(td,tz),y_correct))

4   Pass
tz = 'Asia/Katmandu'; td = [2029 12 31 11 59 00]; y_correct = 'Dec-31-2029 17:44'; assert(isequal(world_time(td,tz),y_correct))

5   Pass
tz = 'Atlantic/Bermuda'; td = [1945 12 05 10 04 00]; y_correct = 'Dec-05-1945 06:04'; assert(isequal(world_time(td,tz),y_correct))