How to use the DateTime2 function from mssql

Find comprehensive JavaScript mssql.DateTime2 code examples handpicked from public code repositorys.

0
1
2
3
4
5
6
7
8
9
'use strict';

var sql = require('mssql');

exports.string = sql.NText;
exports.dateTime = sql.DateTime2;
exports.regExp = sql.NText;
exports.function = sql.NText;
exports.object = sql.NVarChar(4000);
exports.multiple = sql.NText;
fork icon0
star icon1
watch icon3

+ 5 other calls in file

319
320
321
322
323
324
325
326
327
328
case 'date':
  type = mssql.Date
  break
case 'datetime':
  if (param.timezone === 'ignore') {
    type = mssql.DateTime2
  } else {
    type = mssql.DateTimeOffset
  }
  break
fork icon1
star icon0
watch icon2

+ 3 other calls in file

326
327
328
329
330
331
332
333
334
335
var json_execute="{";

for(let i=0;i<campos.length;i++){
    if(!campos_F.includes(campos[i])){ps1.input(campos[i],sql.VarChar);}
    else if(campo_esp.includes(campos[i])){ps1.input(campo_esp[0],campo_esp[1]);}
    else ps1.input(campos[i], sql.DateTime2(0));
    json_execute+='"'+campos[i]+'":"'+valores[i]+'",';
}
ps1.input(campo_id, sql.Int);
json_execute+='"'+campo_id+'":"'+valores[campos.length]+'"}'
fork icon0
star icon0
watch icon0

+ 2 other calls in file

88
89
90
91
92
93
94
95
96
97
case 'sql.VarChar':          return sql.VarChar ;
case 'sql.NVarChar':         return sql.NVarChar ;
case 'sql.Time':             return sql.Time ;
case 'sql.Date':             return sql.Date ;
case 'sql.DateTime':         return sql.DateTime ;
case 'sql.DateTime2':        return sql.DateTime2;
case 'sql.DateTimeOffset':   return sql.DateTimeOffset;
case 'sql.SmallDateTime':    return sql.SmallDateTime;
case 'sql.UniqueIdentifier': return sql.UniqueIdentifier ;
case 'sql.Binary':           return sql.Binary;
fork icon0
star icon0
watch icon0

+ 5 other calls in file