HTML DOM DD Object

The DD object represents an HTML <dd> element. Access a DD Object You can access a <dd> element by using getElementById(): Example var x = document.getElementById(“myDD”); Try it Yourself » Create a DD Object You can create a <dd> element by using the document.createElement() method: Example var x = document.createElement(“DD”); Try it Yourself » Standard Properties and […]

Time and Datetime Variables

SPSS date, time and datetime variables are shown in a nice and readable format such as “8-Jan-2013 16:56:10”. However, they all contain just numbers of seconds. This may sound daunting at first but soon turns out to make all sorts of time manipulations surprisingly easy. It also implies that most SPSS date functions can be used on date, time and datetime […]

Convert String Date to SPSS Date Variable

“I’ve a string variable in my data holding dates formatted as ‘01JAN2016’ without separators between the day, month and year components. To make things worse, the month abbreviations are in Dutch and 3 of those differ from their English counterparts. How can I change this string into an SPSS date variable?” Step 1: Add Separators […]

JavaScript Set Date Methods

Set Date methods let you set date values (years, months, days, hours, minutes, seconds, milliseconds) for a Date Object. Set Date Methods Set Date methods are used for setting a part of a date: Method Description setDate() Set the day as a number (1-31) setFullYear() Set the year (optionally month and day) setHours() Set the […]

JavaScript Date Formats

There are generally 3 types of JavaScript date input formats: Type Example ISO Date “2015-03-25” (The International Standard) Short Date “03/25/2015” Long Date “Mar 25 2015” or “25 Mar 2015” The ISO format follows a strict standard in JavaScript. The other formats are not so well defined and might be browser specific. JavaScript Date Output […]

JavaScript Date Objects

JavaScript Date Output By default, JavaScript will use the browser’s time zone and display a date as a full text string: Thu Jul 05 2018 12:12:01 GMT+0500 (Pakistan Standard Time) You will learn much more about how to display dates, later in this tutorial. Creating Date Objects Date objects are created with the new Date() constructor. There […]