@@ -21,8 +21,8 @@ export class Session implements SessionInterface {
2121 public release ?: string ;
2222 public sid : string = uuid4 ( ) ;
2323 public did ?: string ;
24- public timestamp : number = timestampInSeconds ( ) ;
25- public started : number = timestampInSeconds ( ) ;
24+ public timestamp : number ;
25+ public started : number ;
2626 public duration ?: number = 0 ;
2727 public status : SessionStatus = SessionStatus . Ok ;
2828 public environment ?: string ;
@@ -31,6 +31,9 @@ export class Session implements SessionInterface {
3131 public browser : boolean = false ;
3232
3333 public constructor ( context ?: Omit < SessionContext , 'started' | 'status' > ) {
34+ const startingTime = timestampInSeconds ( ) ;
35+ this . timestamp = startingTime ;
36+ this . started = startingTime ;
3437 if ( context ) {
3538 this . update ( context ) ;
3639 }
@@ -116,8 +119,8 @@ export class Session implements SessionInterface {
116119 init : boolean ;
117120 sid : string ;
118121 did ?: string ;
119- timestamp : number ;
120- started : number ;
122+ timestamp : string ;
123+ started : string ;
121124 duration ?: number ;
122125 status : SessionStatus ;
123126 errors : number ;
@@ -131,8 +134,8 @@ export class Session implements SessionInterface {
131134 return dropUndefinedKeys ( {
132135 sid : `${ this . sid } ` ,
133136 init : this . init ,
134- started : this . started ,
135- timestamp : this . timestamp ,
137+ started : new Date ( this . started ) . toISOString ( ) ,
138+ timestamp : new Date ( this . timestamp ) . toISOString ( ) ,
136139 status : this . status ,
137140 errors : this . errors ,
138141 did : typeof this . did === 'number' || typeof this . did === 'string' ? `${ this . did } ` : undefined ,
0 commit comments