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 8752509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:14:59+00:00 2026-06-13T13:14:59+00:00

I have a GAE app that uses the java.util.Calendar class. My app changes some

  • 0

I have a GAE app that uses the java.util.Calendar class.
My app changes some internal data when a day passes/
Currently I want to test the app, so I have a fake date data-member that I set and modify manually.
I want to save it to the datastore.
After about 2 hours of trying to save it, I decided to wrap it in a class I named FakeDate. it looks like this:

@PersistenceCapable
public class FakeDate {

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;

@Serialized
private Calendar _fakeCurrentDate;

The only problem is, the data of the _fakeCurrentDate is not saved.
At first I set the Calendar date to be 8/8/2012
When I call

pm.makePersistent(_currentDate);

It looks like everything is ok, but when I call

        PersistenceManager pm = PMF.get().getPersistenceManager();
    Query q = pm.newQuery(FakeDate.class);
    try {
        @SuppressWarnings("unchecked")
        List<FakeDate> list = (List<FakeDate>) q.execute();
        for (FakeDate f:list){
            System.out.println(f.getDayOfMonth());
            System.out.println(f.getMonth());
            System.out.println(f.getYear());
        }
    } finally {
        q.closeAll();
        pm.close();
    }

The FakeDate instance I get holds a Calendar instance of the date 27/9/2012. This is the default date I get when calling Calendar.getInstance()

It looks like I am missing something pretty easy.
Am I?

  • 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-06-13T13:15:00+00:00Added an answer on June 13, 2026 at 1:15 pm

    Calendar class is not a supported field type for a datastore model. For details for the supported types take a look at Properties and Value Types. If you need to have a Date field in your model, declare it as java.util.Date and initialize it by using Calendar.

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a small app that uses the GAE. I have parts of
I have a web app on GAE written in Go that performs some calculations
I have a newly coded GWT/GAE app that uses RequestFactory and Editors on the
I have successfully ported some Python code to App Engine that uses PIL's ImageFont
I have a simple GAE app that includes a login/logout link. This app is
I have a WP7 app that is connecting to my GAE backend via oauth.
I'm currently porting my GAE app to Python 2.7 and have come across some
I have a google app engine app that has been running for some time,
I created a GAE app before the budget changes that happend in november (-ish)
I am writing an app on GAE and I have a URL that will

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.