Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6537133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:34:50+00:00 2026-05-25T10:34:50+00:00

I am writing java code for EC2 that will consume messages from SQS. My

  • 0

I am writing java code for EC2 that will consume messages from SQS. My code will run for the hour and then review the queue to determine whether it should shut itself down (due to not enough items to warrant processing for another hour) or to keep running. In order for this to work, I need to know the precise time stamp of when billing for the instance began so I can add one hour to it and shutdown a few minutes before the hour is up if necessary.

How can I get the launch time stamp (the time AWS begins billing for the instance hour) of the EC2 instance my java code is currently running on using the java SDK preferably?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:34:51+00:00Added an answer on May 25, 2026 at 10:34 am

    If shelling to uptime or dropping date +%s > /etc/started-at into your bootscript are too platform-dependent for your tastes, you could perform the DescribeInstances SOAP call and pluck out the launchTime field.

    To discover the running machine’s instance id, you can (from within the machine) make an http GET such as

    curl http://169.254.169.254/latest/meta-data/instance-id
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a program that will change java code. It changes the next-line
I've got a java code that is writing a Linux bash script out, then
I am writing some Java code that authenticates to Active Directory using SASL GSSAPI.
Sometimes while writing Java in Eclipse, I write code that generates warnings. A common
I am writing a piece of code in Java that needs to take a
I am writing java code where i need to get some information from a
I am writing a piece of Java code that needs to send mail to
I'm writing a java package that will be called by another language (matlab). If
i am writing java code to create a tabs.i have done that.but now i
i'm writing a java code that connects and executes commands in a telnet based

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.