Skip to content

Instantly share code, notes, and snippets.

@drfill
Last active December 23, 2015 19:29
Show Gist options
  • Select an option

  • Save drfill/6682526 to your computer and use it in GitHub Desktop.

Select an option

Save drfill/6682526 to your computer and use it in GitHub Desktop.
var date = "24.09.2013 15:50:00" // формат - день.месяц.год час:минута:секунда
var a = new Date();
var regex = /(\d{1,2})\.(\d{1,2})\.(\d{4}) (\d{1,2}):(\d{1,2}):(\d{2})/;
var date2 = regex.exec(date)
var b = new Date(date2[3], parseInt(date2[2])-1, date2[1], date2[4], date2[5], date2[6]);
var clksec = parseInt((b - a) / 1000);
var clock = $('.your-clock').FlipClock(clksec, {
clockFace: 'DailyCounter',
countdown: true
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment