Get the Lundar date in 'xxxx-xx-xx' fromat
176970
def lunar_date() 
      l = convert(@date.year, @date.month, @date.day)
      l[0].to_s + "-" + l[1].to_s + "-" + (/^\d+/.match(l[2].to_s)).to_s
    end
218559
function getDateParts (value) {
  if (!value || value.length === 0) {
    return
  }

  if (typeof value === 'object') {
    value = moment(value).format('DD/MM/YYYY')
  }

  const seperator = (value.indexOf('-') !== -1) ? '-' : '/'
  if (value.indexOf('T') !== -1) {
    value = value.substr(0, value.indexOf('T'))
  }
  const parts = value.split(seperator)

  if (seperator === '/') {
    return parts
  }

  return [parts[2], parts[1], parts[0]]
}
581996
function fuzzydate(s) {
	var o = new Date(s), n = new Date(NaN);
	var y = o.getYear(), m = o.getMonth(), d = o.getDate();
	if(isNaN(d)) return n;
	if(y < 0 || y > 8099) return n;
	if((m > 0 || d > 1) && y != 101) return o;
	if(s.toLowerCase().match(/jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec/)) return o;
	if(!s.match(/[a-zA-Z]/)) return o;
	return n;
}
170887
def getLTime():
    """"""

    _ltime = _time.localtime(_time.time())
    tlm_str = _time.strftime('%H:%M:%S (%d/%m/%Y)', _ltime)
    return tlm_str
536354
function getValidDate (y, m, d, h, i, s, ms) {
  var date = new Date(y, m - 1, d, h, i, s, ms);
  if (
      y  === date.getFullYear()  &&
      m  === date.getMonth() + 1 &&
      d  === date.getDate()      &&
      h  === date.getHours()     &&
      i  === date.getMinutes()   &&
      s  === date.getSeconds()   &&
      ms === date.getMilliseconds()
  ) {
    return date;
  } else {
    return null;
  }
}
718181
function getDate(node) {
    var text = getText(node);
    if (!text) {
        return undefined;
    }
    if (text.indexOf(':') > 0) {
        return new Date(text);
    }
    var bytes = new DataView(ByteUtils.arrayToBuffer(ByteUtils.base64ToBytes(text)));
    var secondsFrom00 = new Int64(bytes.getUint32(0, true), bytes.getUint32(4, true)).value;
    var diff = (secondsFrom00 - EpochSeconds) * 1000;
    return new Date(diff);
}
733188
function clampDate(date, minDate, maxDate) {
       var boundDate = date;
       if (minDate && date < minDate) {
         boundDate = new Date(minDate.getTime());
       }
       if (maxDate && date > maxDate) {
         boundDate = new Date(maxDate.getTime());
       }
       return boundDate;
     }
1293722
def str2dt(s):
    """"""
    return datetime.datetime.strptime(s, _FMTS if s.count(":") == 2 else _FMT if s.count(":") == 1 else _FMT0)
65061
function dateStrGetter(name, width, form, extended) {
    if (form === void 0) { form = FormStyle.Format; }
    if (extended === void 0) { extended = false; }
    return function (date, locale) {
        return getDateTranslation(date, locale, name, width, form, extended);
    };
}
928561
function () {
    var date = new Date();
    var dateStr = this._parseDate();
    var hours = date.getHours();
    var minutes = date.getMinutes();
    var seconds = date.getSeconds();

    hours = (hours+'').length === 1 ? '0' + hours : hours;
    minutes = (minutes+'').length === 1 ? '0' + minutes : minutes;
    seconds = (seconds+'').length === 1 ? '0' + seconds : seconds;

    dateStr = dateStr + '_' + hours;
    dateStr = dateStr + '_' + minutes;
    dateStr = dateStr + '_' + seconds;

    return dateStr;
  }
1034423
function getDate(ymValue) {
	checkNumber(ymValue)
	var utcFullYear = Math.floor(ymValue / monthsPerYear) + zeroUtcFullYear
	var utcMonth = modFix(Math.floor(ymValue), monthsPerYear) + zeroUtcMonth
	return new Date(Date.UTC(utcFullYear, utcMonth))
}
244086
private String utilDateToStr(Date pdt, String pstrFmt)
    {
        String strRet = null;
        SimpleDateFormat dtFmt = null;

        try
        {
            dtFmt = new SimpleDateFormat(pstrFmt);
            strRet = dtFmt.format(pdt);
        }
        catch (Exception e)
        {
            strRet = null;
        }
        finally
        {
            if (dtFmt != null) dtFmt = null;
        }
        return strRet;
    }
822681
function parseDate( str ) {
	var v = Date.parse( str );
	if ( isnan( v ) ) {
		return new TypeError( 'invalid value. Unable to parse string as a date. Value: `' + str + '`.' );
	}
	return new Date( v );
}
605391
function getDayData(input){
    var data = csvTable(input,"\t");
    var today = new Date().getTime(); //getDateDDMMYYYY();
    var header = data[0];
    var column = 2;
    var minDiff = Number.MAX_SAFE_INTEGER;
    while(column<header.length){
        var columnDate =  new Date(header[column]+' 12:00:00 GMT-0500').getTime();
        if(Math.abs(today-columnDate)<minDiff){
            column++;
            minDiff = Math.abs(today-columnDate);
        }
        else{
            column--;
            break;
        }

    }
    if(column>=header.length){
        return null;
    }
    var result = new Array(data.length-1);
    for(var i=1;i<data.length;i++){
        result[i-1]={id:data[i][0],value:Number(data[i][column]),date:header[column]};

    }

    var table = new Array();
    table.push(result);
    for(var k=2;k<=column-1;k++){
        var row = new Array(data.length-1);
        for(var i=1;i<data.length;i++){
            row[i-1]={id:data[i][0],value:Number(data[i][k]),date:header[k]};
        }
        table.push(row);
    }

    return table;
}
756118
function(aDate, bDate, addSub) {
            if(typeof(addSub) == 'undefined') { addSub = true };
            if(! aDate) { return bDate; }
            if(! bDate) { return aDate; }
            var a = Number(aDate);
            var b = Number(bDate);
            var c = addSub ? a + b : a - b;
            return new Date(c);
        }
268914
function(dt) {
		dt = dt || new Date();
		return [dt.getFullYear(),
			padNumber(dt.getMonth() + 1),
			padNumber(dt.getDate()),
			padNumber(dt.getHours()),
			padNumber(dt.getMinutes()),
			padNumber(dt.getSeconds())
		].join('');
	}
1064430
private Date parseDate(CmsXmlContentValueLocation dateLoc) {

        if (dateLoc == null) {
            return null;
        }
        String dateStr = dateLoc.getValue().getStringValue(m_cms);
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(dateStr)) {
            return null;
        }
        try {
            return new Date(Long.parseLong(dateStr));
        } catch (Exception e) {
            LOG.info(e.getLocalizedMessage() + " date = " + dateStr, e);
            return null;
        }
    }