Monday, November 25, 2013

EPG - Electronic Program Guide

EPG gives the information to the user about the events of a services present in DVB. The EPG data is sent through EIT (Event Information Table). The information such as, Program name, Start Date, Start Time, Duration, Short and Detailed description are possible with this EIT data.

The information comes under EIT are classified into three categories, they are,

  • Current/Next Information
  • Event Schedule
  • Extended Info

Wednesday, September 18, 2013

Java Script Code for converting MJD to date(YMD)

// Convert mjd to/from Month, Day, Year,

function MJDtoYMD (mjd_in)
{
    var year;
    var month;
    var day;
    var hour;
    var jd;
    var jdi;
    var jdf
    var l;
    var n;
   
   
    // Julian day
    jd = Math.floor (mjd_in) + 2400000.5;

    // Integer Julian day
    jdi = Math.floor (jd);
   
    // Fractional part of day
    jdf = jd - jdi + 0.5;
   
    // Really the next calendar day?
    if (jdf >= 1.0) {
       jdf = jdf - 1.0;
       jdi  = jdi + 1;
    }


    hour = jdf * 24.0;  
    l = jdi + 68569;
    n = Math.floor (4 * l / 146097);
 
    l = Math.floor (l) - Math.floor ((146097 * n + 3) / 4);
    year = Math.floor (4000 * (l + 1) / 1461001);
   
    l = l - (Math.floor (1461 * year / 4)) + 31;
    month = Math.floor (80 * l / 2447);
   
    day = l - Math.floor (2447 * month / 80);
   
    l = Math.floor (month / 11);
   
    month = Math.floor (month + 2 - 12 * l);
    year = Math.floor (100 * (n - 49) + year + l);

    if (month < 10)
       month = "0" + month;
     
    if (day < 10)
       day = "0" + day;
   
    //year = year - 1900;
   
    return (new Array (year, month, day));

}