Tag Archives: date

JavaScript30—Day 2

JavaScript30 is 30-day vanilla javaScript coding challenge by Wes Bos (@wesbos). The purpose of these posts is to reflect my troubles and moments of ahhaa. Lessons from Day 2 — CSS-JS clock: Demo - Day 2
  1. Date() gives a chance to get hours, minutes, seconds etc.
    const now = new Date();
    seconds = now.getSeconds();
    minutes = now.getMinutes();
    hours = now.getHours()
    
    
    
  2. transform-origin vs transform:rotate() The first one sets the point around which the transformation takes place. Rotate() is driven by center of the element. More about MDN transform-origin.
Day 2 code on github.

Month’s first and last day

How to get month's first and last day in case you have your own variables? $month = 5; $full_year = 2016; For first day we can use: date("01.$month.$full_year"); // 01.05.2016 And for the last year: date("t.$month.$full_year"); // 31.05.2016