dow today code example

Example 1: javascript current date add 30 days

var future = new Date();
future.setDate(future.getDate() + 30);

Example 2: 1 day ago python datetime

date_N_days_ago = datetime.now() - timedelta(days=N)

Example 3: get current time epoch javascript

var a = Date.now();

// Returns miliseconds since epoch

Example 4: dax get last snapshot

UnitsInStockExtended:=CALCULATE(
    SUM(SnapshotTable[ValueToGet]),
    LASTNONBLANK (
   	  SnapshotTable[Date],
      CALCULATE (SUM(SnapshotTable[ValueToGet]))
    )
)

Example 5: get current day java

Calendar calendar = Calendar.getInstance();
int day = calendar.get(Calendar.DAY_OF_WEEK); 

switch (day) {
    case Calendar.SUNDAY:
        // Current day is Sunday
        break;
    case Calendar.MONDAY:
        // Current day is Monday
        break;
    case Calendar.TUESDAY:
        // etc.
        break;
}