defining methods similar to Javascript Date object