Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Time, Timezone and Expressions

  • Time, Timezone and Expressions

    Posted by Rafael Oliveira on February 1, 2007 at 4:05 pm

    Hello expressions gurus!

    I work for a TV network that broadcasts internationally, and we in the promo division have to make the time schedules that appear on the promos and teasers. This is done manually, and we enter the day of week, up to 6 scheduled hours around the world, covering several different timezones.

    I have managed to write a little “script” to automate the calculations of the schedules of the different timezones.

    However I now have a problem. Our format *has* to say the day of the week the program airs, and it is relative to the first time of the first country that is shown. This leads to the program being shown on different days in different countries, as I’ll show on my little schematic below:

    SUNDAY
    LONDON 5:30 18:45
    LUANDA 4:30 17:45
    TOKYO 12:30 01:45+

    So, as such, the second airing on Tokyo actually happens on Monday. We indicate that using that + sign.

    My question is, is there a way to compare a given time to the first one, so that if it is after midnight I can turn the plus sign automatically, or turn them off?

    Thanks!

    Rafael

    Rafael Oliveira replied 19 years, 3 months ago 3 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    February 1, 2007 at 11:21 pm

    I think the only way it would know would be if the second time were less than the first time (assuming a 24 hour clock). That would limit your range to +24 hours. If that’s the case, you could just convert the two times to minutes, see if the second time is less than the first time, and add the “+” if it is. Or maybe I’m not understanding…..

    Dan

  • Lloyd Alvarez

    February 2, 2007 at 10:29 pm

    Judging by your example I assume that your script calculates the schedules on fixed offsets.

    So the second show is 13 hours and 15mins after the 1st and tokyo’s showing is 7 hours after london’s.

    Can’t you write a conditional that basically add’s the offset’s at each stage and when it goes over 24 it adds the plus?

    something like this:

    startTimeHours = 5;
    startTimeMins = 30;

    city2_Offset = -1;
    city3_Offset = 7;
    showOffset = 13.25;

    city1_time1 = startTimeHours + (startTimeMins/60);

    city1_time2 = city1_time1 + showOffset;
    city2_time1 = city1_time1 + city2_Offset;
    city2_time2 = city2_time1 + showOffset;
    city3_time1 = city1_time1 + city3_Offset;
    city3_time2 = city3_time1 + showOffset;

    if (city1_time1 + showOffset > 24) {
    city1_time2 = city1_time2 + “+”;

    }else{

    if (city1_time2 + city2_Offset > 24 {
    city2_time2 = city2_time2 + “+”;

    }else{

    if (city1_time2 + city3_Offset > 24 {
    city3_time2 = city3_time2 + “+”;

    }

    -lloyd

  • Rafael Oliveira

    February 3, 2007 at 6:54 pm

    Dan and Lloyd,
    Thank you both, from both your posts I’ve got some ideas on how to proceed with this. I’m trying to do this whole thing slider-based (not defining actual variables) as I have to do lots of these things per day, around 30.
    What I think I’ll do is the following: I would use a slider to enter the hour of the day on my timezone (Brazil) and another for the minutes, since they don’t change. Then I’ll create the appropriate show times in the other timezones, convert them to minutes, and then compare them to 1441 (that’s midnight and one) which is the time the plus sign appears. If the time is over that, a sign shows up, if not, no sign. The exception is when the first show time is over midnight, than nobody gets a sign.

    Now I’ll brainstorm on *how* to actually program that…

    Thanks again!

    Rafael

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy