#cryptoboyjr_code

1 messages · Page 1 of 1 (latest)

grim oysterBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1222632005749964810

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

dapper sedgeBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

jade dawn
#

Public datetime? Expiresat

#

Can you give .net example?

dapper sedgeBOT
jade dawn
#

Cant figure out the correct syntax for expires at

#

Researching ty

#

Would be nice to see syntax

#

Having trouble converting to the appropriate date/Time needed

last patio
#

Looks like you want something like DateTime currentTime = DateTime.UtcNow; long unixTime = ((DateTimeOffset)currentTime).ToUnixTimeSeconds();

jade dawn
#

Expiresat wants datetime?

#

Not long

last patio
#

err yeah but its value should be Unix

jade dawn
#

I understand that

#

I see the Unix time but I need date too

#

Sorry don't knew much about Unix time

last patio
#

What do you mean by "I need date too"?

#

The Unix time does represent the date

#

And you can see how it converts

jade dawn
#

public DateTime? ExpiresAt { get; set; }

#

Can't use long

last patio
#

Yeah I was just grabbing an example from a StackOverflow of getting Unix

jade dawn
#

That's what I'm missing how to convert the long to date time

#

Convert.todatetime(long) is not working

jade dawn
#

Interesting. I'm researching.

#

There's something wrong

#

public static DateTime UnixTimestampToDateTime(double unixTime)
        {
            DateTime unixStart = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc);
            long unixTimeStampInTicks = (long)(unixTime * TimeSpan.TicksPerSecond);
            return new DateTime(unixStart.Ticks + unixTimeStampInTicks, System.DateTimeKind.Utc);
        }

#

This should work but stripe keeps failing

#

Doesn't like the date

#

Date looks fine to me

last patio
#

Maybe try something like ExpiresAt = DateTime.UtcNow + new TimeSpan(2, 0, 0) // Configured to expire after 2 hours

jade dawn
#

Ty testing

#

Works for 1 hour. Trying for 20 min

grim oysterBOT
jade dawn
#

Timespan(0, 20, 0)?

#

For 20 minutes?

last patio
#

I believe so

jade dawn
#

Errors

#

I think the minimum time is 30

last patio
#

Minimum is 30 min

#

Sorry

#

Forgot to mention that

jade dawn
#

Yeah

#

Ty ty

#

Ty for your patience

#

Please close ticket