• The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

How I have set expiration date for client add from API RPC XML(C#)

A

AvisS

Guest
Hi,

I am C# developer. I have written some code for clients (user) add from Local system to plesk web server through API. I have used API RPC protocol version is 1.4.2.0 .


The code is working fine for me. But main problem in that, I can’t set those clients expiration date.

Here is some XML request
<limits>
<disk_space>100000</disk_space>
<max_dom>50</max_dom>
<max_subdom>250</max_subdom>
<max_webapps>30</max_webapps>
<max_traffic>50000</max_traffic>
<max_db>200</max_db>
<mysql_dbase_space>50000</mysql_dbase_space>
<max_shared_ssl_links>50</max_shared_ssl_links>
<expiration>1134616208</expiration>
</limits>


Can you please suggest me, here which date format is used?


Thanks,
Avis
 
Hi IgorG,

No, it is not working properly.

Here is my code:sb.Append("<expiration>" + DateTime.Now.AddYears(1).Date.ToString("yyyyMMdd") + "</expiration>");

And XML request is: <expiration>20120112</expiration>

After that when I have added the client, it shows expiration date is 21- Aug – 1970


Thanks,
Avis
 
Same error here ...

yyyyMMdd format is not valid, I get a date of 1970

I change expiration with control panel and I get the date "1298329200" as 25-Feb-2011...
 
Try to use http://www.epochconverter.com/ to calc your date

"The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds"

In C# you can try:
epoch = (DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000;
 
Back
Top