Configuring Time Zones
  • 10 Oct 2024
  • 8 Minutes to read
  • Dark
    Light
  • PDF

Configuring Time Zones

  • Dark
    Light
  • PDF

Article summary

Java SDK.NET SDKREST API

Java SDK

To download the full code sample see our Code Share site.

Transactions can be configured to display in a specific time zone. This means that visible time components, like the signature time stamp and date fields, will format and display according to the specified time zone. This can be done at the following levels:

  • By Account

  • By Sender Time Zone

  • By Package Time Zone

Specifying Time Zones By Account

Specifying time zone at the Account level changes the default time zone for any new Senders in the account to the newly specified time zone. You can have this configured by contacting our our Support Team.

Specifying Time Zones By Sender

Specifying a time zone at the sender level is useful when you have multiple senders in different time zones. Once this done, any new transaction created by you sender will inherit the time zone configuration you configured for them.

The following code will do this:

SenderInfo updatedSender = 
SenderInfoBuilder.newSenderInfo("xx@example.com")
.withTimezoneId("America/Toronto").build();

eslClient.getAccountService().updateSender(updatedSender,"sender_id");

Specifying Time Zones By Package

Transactions usually default to the time zone of the sender creating the transaction. However, you can override this by setting a specific time zone for the transaction.

You can also create a template with a specific time zone. Any transaction created from this template will then inherit this time zone.

When creating a transaction, you can set a time zone id by calling the WithTimezoneId() function through the PackageBuilder object. The following code shows you how to create one transaction with EST time zone, while adding one signature and one date field.

DocumentPackage pkg = PackageBuilder.newPackageNamed("Test Time Zone")
        .withSigner(SignerBuilder.newSignerWithEmail("signer1@example.com" )
                .withFirstName("signer1 firstname")
                .withLastName("signer1 lastname")
                )
        .withDocument(DocumentBuilder.newDocumentWithName("document 1")
        		.fromFile("file_path")
        		.withSignature(SignatureBuilder.signatureFor("signer1@example.com")
        				.onPage(0)
        				.atPosition(100, 300)
.withSize(200, 75))
                )
        .withTimezoneId("America/Toronto")
        .build();
 
PackageId packageId = eslClient.createPackageOneStep(pkg);
eslClient.sendPackage(packageId);

Results

Here is an example of what you can expect to see once you have run your code.

Here are the date formats used for the signature fields:

{
 "signatureFormat": "e-Signed by $signer_name; \n on $date;",
 "signatureDateFormat":"yyyy-MM-dd HH:mm:ss z"
} 

And for the date field:

{
 "aws.document.autofield.date.format" : "yyyy-MM-dd HH:mm:ss z"
}

You can have these formats updated per your requirements by contacting our Support Team.

.NET SDK

To download the full code sample see our Code Share site.

Transactions can be configured to display in a specific time zone. This means that visible time components, like the signature time stamp and date fields, will format and display according to the specified time zone. This can be done at the following levels:

  • By Account

  • By Sender Time Zone

  • By Package Time Zone

Specifying Time Zones By Account

Specifying time zone at the Account level changes the default time zone for any new Senders in the account to the newly specified time zone. You can have this configured by contacting our our Support Team.

Specifying Time Zones By Sender

Specifying a time zone at the sender level is useful when you have multiple senders in different time zones. Once this done, any new transaction created by you sender will inherit the time zone configuration you configured for them.

The following code will do this:

            //update existing sender's time zone
            SenderInfo updatedSender = SenderInfoBuilder.NewSenderInfo("xx@example.com")
                    .WithTimezoneId("JST")
                    .Build();
            eslClient.AccountService.UpdateSender(updatedSender, "GAfpUrfGLFQL");
        }

Specifying Time Zones By Package

Transactions usually default to the time zone of the sender creating the transaction. However, you can override this by setting a specific time zone for the transaction.

You can also create a template with a specific time zone. Any transaction created from this template will then inherit this time zone.

When creating a transaction, you can set a time zone id by calling the WithTimezoneId() function through the PackageBuilder object. The following code shows you how to create one transaction with EST time zone, while adding one signature and one date field.

            DocumentPackage pkg = PackageBuilder.NewPackageNamed("Test Time Zone" + new DateTime())
               .WithSigner(SignerBuilder.NewSignerWithEmail("signer1@example.com")
                       .WithFirstName("signer1 firstname")
                       .WithLastName("signer1 lastname")
                       )
               .WithDocument(DocumentBuilder.NewDocumentNamed("document 1")
                       .FromFile(FILE_PATH)
                       .WithSignature(SignatureBuilder.SignatureFor("signer1@example.com")
                               .OnPage(0)
                               .AtPosition(100, 300)
                               .WithSize(200, 75))
                       )
               .WithTimezoneId("America/Toronto")
               .Build();
            PackageId packageId = eslClient.CreatePackageOneStep(pkg);
            eslClient.SendPackage(packageId);

Results

Here is an example of what you can expect to see once you have run your code.

Here are the date formats used for the signature fields:

{
 "signatureFormat": "e-Signed by $signer_name; \n on $date;",
 "signatureDateFormat":"yyyy-MM-dd HH:mm:ss z"
} 

And for the date field:

{
 "aws.document.autofield.date.format" : "yyyy-MM-dd HH:mm:ss z"
}

You can have these formats updated per your requirements by contacting our Support Team.

REST API

To download the full code sample see our Code Share site.

Transactions can be configured to display in a specific time zone. This means that visible time components, like the signature time stamp and date fields, will format and display according to the specified time zone. This can be done at the following levels:

  • By Account

  • By Sender Time Zone

  • By Package Time Zone

Specifying Time Zones By Account

Specifying time zone at the Account level changes the default time zone for any new Senders in the account to the newly specified time zone. You can have this configured by contacting our our Support Team.

Specifying Time Zones By Sender

Specifying a time zone at the sender level is useful when you have multiple senders in different time zones. Once this done, any new transaction created by you sender will inherit the time zone configuration you configured for them.

The following code will do this:

HTTP Request

POST /api/account/senders/{senderId}

HTTP Headers

Accept: application/json
Content-Type: application/json
Authorization: Basic api_key

{
    "timezoneId" : "JST"
}

For new senders, you can first invite them and then update their time zone setting in two different steps, check Senders guide for how to invite senders.

Specifying Time Zones By Package

Transactions usually default to the time zone of the sender creating the transaction. However, you can override this by setting a specific time zone for the transaction.

You can also create a template with a specific time zone. Any transaction created from this template will then inherit this time zone.

HTTP Request

POST /api/packages

HTTP Headers

Authorization: Basic api_key

Accept: application/json

Content-Type: multipart/form-data

Request Payload

------WebKitFormBoundary1bNO60n7FqP5WO4t
Content-Disposition: form-data; name="file"; filename="testDocumentExtraction.pdf"
Content-Type: application/pdf
%PDF-1.5
%µµµµ
1 0 obj
<>>>
endobj.... 
------WebKitFormBoundary1bNO60n7FqP5WO4t
Content-Disposition: form-data; name="payload"
{
   "roles":[
      {
         "id":"Role1",
         "signers":[
            {
               "email":"signer1@example.com",
               "firstName":"1.firstname",
               "lastName":"1.lastname",
               "company":"OneSpan Sign"
            }
         ]
      },
      {
         "id":"Role2",
         "signers":[
            {
               "email":"signer2@example.com",
               "firstName":"2.firstname",
               "lastName":"2.lastname",
               "company":"OneSpan Sign"
            }
         ]
      }
   ],
   "documents":[
      {
         "approvals":[
            {
               "role":"Role1",
               "fields":[
                  {
                     "page":0,
                     "top":100,
                     "subtype":"FULLNAME",
                     "height":50,
                     "left":100,
                     "width":200,
                     "type":"SIGNATURE"
                  }
               ]
            },
            {
               "role":"Role2",
               "fields":[
                  {
                     "page":0,
                     "top":300,
                     "subtype":"FULLNAME",
                     "height":50,
                     "left":100,
                     "width":200,
                     "type":"SIGNATURE"
                  }
               ]
            }
         ],
         "name":"Test Document"
      }
   ],
   "name":"Text Timezone Setting",
   "type":"PACKAGE",
   "timezoneId":"JST",
   "language":"en",
   "emailMessage":"",
   "description":"New Package",
   "autocomplete":true,
   "status":"SENT"
}
------WebKitFormBoundary1bNO60n7FqP5WO4t--

Response Payload

{
    "id": "9sKhW-h-qS9m6Ho3zRv3n2a-rkI="
}

Here is an example of what you can expect to see once you have run your code.

Here are the date formats used for the signature fields:

{
 "signatureFormat": "e-Signed by $signer_name; \n on $date;",
 "signatureDateFormat":"yyyy-MM-dd HH:mm:ss z"
} 

And for the date field:

{
 "aws.document.autofield.date.format" : "yyyy-MM-dd HH:mm:ss z"
}

You can have these formats updated per your requirements by contacting our Support Team.


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.
ESC

Ozzy, our interactive help assistant